Reputation: 1239
I use this code:
<buton class="audio-button {{audio.isPlaying && 'active'}}"></button
Is this practice are normal or it will make problems?
Upvotes: 0
Views: 30
Reputation: 33141
I assume that you want to add the active class if audio.isPlaying is true. In that case, you should be using ng-class.
audio.isPlaying
ng-class
<button class="audio-button" ng-class="{ 'active' : audio.isPlaying }"></button>
You can read more about it here
Upvotes: 2