Created
May 23, 2014 22:04
-
-
Save mgonto/d61fdbc8a935434a2ede to your computer and use it in GitHub Desktop.
Reactive Example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div data-repat="app in AppTypes" data-class="app.name"> | |
<div data-class="{selected: app.selected}"></div> | |
<a on-click="apptypeselect(app)">{{app.name}}</a> | |
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var AppTypes= [{ | |
name: 'name1', | |
selected: false | |
}, { | |
name: 'name2', | |
selected: false | |
}, { | |
name: 'name3', | |
selected: false | |
}]; | |
TutorialView.prototype.apptypeselect = function(app) { | |
_.each(AppTypes, function(app) { | |
app.selected = false; | |
}); | |
app.selected = true; | |
scrollTo(_.indexOf(AppTypes, app)) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment