A
A
Artem2015-07-15 09:38:04
Angular
Artem, 2015-07-15 09:38:04

How to highlight the active block based on the variable in $scope?

There is a site with tracks, tracks with a signature and a picture - 9 card blocks per page, pagination via ajax ($http.get), based on json - yii2 rest controller responses. And there is a jplayer with a playlist in the header of the site (when you go to the page, the playlist also reloads). I output the records 'ng-repeat track by $index'. $scope contains the index of the currently playing track - $scope.currentPlaying. On the cards, respectively, the play-pause buttons, which are ng-hide based on whether currentPlaying is equal to $index.
Question - how to force all blocks to follow the state of the currentPlaying variable and hide the pause button if their index of this variable is not equal, without redrawing the entire page? I am familiar with angular for the fifth day, I have no idea where to look for it yet, I smoke docks for $watch. I hope I explained clearly, I will be glad to answer clarifying questions.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question