I have some problem with Bootstrap UI Tabs in AngularJS ui-router. I want to add active class when refresh the page, so I send tab's URL into asActive(url) function, as parametr to my controller, where I compare that tab's URL with current URL of entire page. It works properly. I use "active" parametr of tab-directive, that is bindind with "=".
When I refresh my page - everything is OK, but when I click on the tab pane I got an error in console.
Expression 'isActive('configuration.partnership-groups')' used with directive 'tab' is non-assignable!
So, my html:
<tabset justified="true">
<tab heading="DV Group" ui-sref="configuration.dv-group" active="isActive('configuration.dv-group')">
<div ui-view></div>
</tab>
<tab heading="Partneship group" ui-sref="configuration.partnership-groups" active="isActive('configuration.partnership-groups')">
<div ui-view></div>
</tab>
<tab heading="Permissions" ui-sref="configuration.permissions" active="isActive('configuration.permissions')">
<div ui-view></div>
</tab>
</tabset>
And my controller:
$scope.isActive = function (state) {
return angular.equals(state, $state.$current.name);
};
Anybody knows solution of this issue? Thanks in advance.