I'm trying to figure out why my list of checkboxes (from ng-repeat="song in myCtrl.genreSelected") is not showing properly
I have some radio boxes where you can select one of 3 music genres:
<input type="radio" name="genre" ng-value="myCtrl.rockSongs" ng-model="myCtrl.genreSelected"> Rock
<input type="radio" name="genre" ng-value="myCtrl.rapSongs" ng-model="myCtrl.genreSelected"> Pop
<input type="radio" name="genre" ng-value="myCtrl.popSongs" ng-model="myCtrl.genreSelected"> Rap
And I want whichever radio is selected to create a list of checkboxes with the names of those songs:
<input type="checkbox" name="song" ng-repeat="song in myCtrl.genreSelected" ng-checked={{song.checked}}>{{song.song}}
Here are the songs in the controller for each genre:
this.rockSongs = [{song: "Rock song #1", checked: true},
{song: "Rock song #2", checked: false},
{song: "Rock song #3", checked: false},
{song: "Rock song #4", checked: false},
{song: "Rock song #5", checked: false}];
this.rapSongs = [{song: "Rap song #1", checked: false},
{song: "Rap song #2", checked: false},
{song: "Rap song #3", checked: false},
{song: "Rap song #4", checked: false},
{song: "Rap song #5", checked: false}];
this.popSongs = [{song: "Pop song #1", checked: false},
{song: "Pop song #2", checked: false},
{song: "Pop song #3", checked: false},
{song: "Pop song #4", checked: false},
{song: "Pop song #5", checked: false}];
Right now I have the rock songs to appearing on load:
this.genreSelected = this.rockSongs;
Right now the checkbox list appears from the ng-repeat with the check selected if checked: true. But the name of the song does not appear where I have {{song.song}}