Change 'class' when changing view

1

I'm using bootstrap and angular

I have a nav:

<ul class="nav nav-tabs nav-justified" ng-model="activeVar" style="margin-top:50px;">
            <li role="presentation"><a value="overview" ui-sref="main.admin.shops.single.overview">Übersicht</a></li>
            <li role="presentation"><a value="inventory" ui-sref="main.admin.shops.single.inventory">Produkte</a></li>
            <li role="presentation"><a value="orders" ui-sref="main.admin.shops.single.orders">Bestellungen</a></li>
            <li role="presentation"><a value="settings" ui-sref="main.admin.shops.single.settings">Einstellungen</a></li>
</ul>

I would like to apply to class active when certain option is selected. How would you do that? Usage angularjs on my system

    
asked by anonymous 02.08.2017 / 13:48

1 answer

1

Add the ui-sref-active directive, as in the following example:

<li role="presentation" ui-sref-active="active">
    <a value="overview" ui-sref="main.admin.shops.single.overview">Übersicht</a>
</li>
    
02.08.2017 / 14:53