Having trouble with Bootstrap UI Tabs in AngularJS ui-router. Trying to add an active class when refreshing the page. Passing the tab's URL to the asActive(url) function in my controller to compare with the current URL of the page. Using the "active" parameter of the tab directive, which is bound with "=".
Refreshing the page works fine, but clicking on the tab pane results in an error in the console.
Expression 'isActive('configuration.partnership-groups')' used with directive 'tab' is non-assignable!
My HTML code:
<tabset justified="true">
<tab heading="DV Group" ui-sref="configuration.dv-group" active="isActive('configuration.dv-group')">
<div ui-view></div>
</tab>
<tab heading="Partnership 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 the controller:
$scope.isActive = function (state) {
return angular.equals(state, $state.$current.name);
};
Any solutions to this issue? Thank you in advance.