Created
January 30, 2015 15:30
-
-
Save DavidSouther/c5213d3a3ec09a9ff2ca to your computer and use it in GitHub Desktop.
Song Flux 6 - LibraryComponent
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
function LibraryController(Library, Actions) { | |
this.Library = Library; // A library has albums, which have tracks | |
this.albums = Library.albums; // Updates on Library mutation events | |
this.Actions = Actions; | |
} | |
LibraryController.prototype.play = function(track) { | |
return this.Actions.Play(track).dispatch(); | |
}; | |
LibraryController.$inject = ['TrkstrLibrary', 'TrkstrActions']; |
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
<ol ng-repeat="album in state.albums"> | |
<li>{{ album.name }}</li> | |
<li | |
ng-repeat="track in album.tracks" | |
ng-click="state.play(track)" | |
>{{ track.title }}</li> | |
</ol> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment