So I am having an issue with using these two. If I right click on the ui-sref
and click open in new tab it opens just fine and I stay logged in. However if I right click on an item that has an ng-click
and I use $stae.go
it logs me out of my app and does not navigate me to the page. Is there a way I can get the ui-sref
new tab behavior while using $state.go
?
Here is some code:
If I right click and open in new tab it works fine
<a ui-sref="app.locations" ui-sref-active="active"
ng-class="{active: $root.state.includes('app.locationDetail')}">
<div class="sub-menu-icon">
<i class="icon-locations"></i>
</div>
<span class="sub-menu-label">Locations</span>
</a>
If I right click and open in new tab and this method gets called it logs me out and doesnt navigate me.
<a href ng-click='vm.viewDetail(dataItem)'><span>" + value + "</span></a>
which calls this in the viewDetail
method
vm.viewDetail = function ($event, dataItem) {
var id = dataItem.id;
$state.go(vm.detailRoute, {id: id});
};
Is there something I need to add to the $state.go
method to stop this from happening?