I was thinking how to change class and add HTML if user pick language (see code below)
<li>
<a ng-click="changeLanguage('en')">English</a>
</li>
to something like this:
<li>
<a ng-click="changeLanguage('en')" class="active">English
<span class="icon icon-tick"></span>
</a>
</li>
My first idea was something like to add something like $scope.active and then use ng-class
ng-class="{'active': active, '': !active}"
But this not work with that HTML below and I'm also not sure if it work correctly with my class.
Can someone advise me how to do things like this in Angular? Thanks
EDIT: I wasn't specific enaugh, i have more languages in option so HTML looks like:
<ul class="reset">
<li>
<a ng-click="changeLanguage('en')">English</a>
</li>
<li>
<a ng-click="changeLanguage('cs')" class="active">
Česky
<span class="icon icon-tick"></span>
</a>
</li>
</ul>
Where "CS" is how it should always look like when some language is active and EN is how it should looks like when that language is not active