Currently off the EmberJS wagon for now, and checking out AngularJS. I was trying to create a list of song titles with a “Like” link next to them. When you click on “Like” a count for the number of likes is listed next to the song title. Here’s my jsfiddle and thanks for your help! http://jsfiddle.net/stevenng/SpQH5/7/
Currently off the EmberJS wagon for now, and checking out AngularJS. I was trying
Share
Making your $scope.like function do this will work (http://jsfiddle.net/SpQH5/9/):
Due to Angular’s data-binding
{{song.like}}is automatically updated in the DOM whensong.likeis incremented.Note you can also accomplish this without a scope function by incrementing
song.likein theng-clickdirectly like in this fiddle: