Skip to content Skip to sidebar Skip to footer

Angularjs Display List Right Below The Url

So I am trying to display a list of values on the front end right below where they are clicked. For instance, lets say my front end has a list of albums: album-name-1 album-name-2

Solution 1:

I think you should have markup like this

<ul><ling-repeat="album in vm.albums"><ang-click="vm.getAlbumTracks(album, $index);">{{album}}</a><ulng-show="$index === vm.showingAlbumIndex"><ling-repeat="track in vm.albums.tracks"><ang-click="vm.displayForm(track)">{{track}}</a></li></ul></li></ul><ang-click="vm.newFunction('RAVI')">Click Me!</a>

In function controller, assign property vm.showingAlbumIndex

functiongetAlbumTracks(album, index){
    vm.showingAlbumIndex = index;
    //...
}

Post a Comment for "Angularjs Display List Right Below The Url"