In ui-router, when you call state.go, you can define options to prevent the location from changing by passing {location:false}
. However, how do I define a state using $stateProvider.state
so it doesn't change the location? I've defined a rule for custom URL handling, but now it is changing the location value.
I have foo
state -
$stateProvider
.state('foo', {
url: '/foo'
templateUrl: '',
controller: function($scope) {
console.log('made it!');
}
});
I have a custom rule -
$urlRouterProvider.rule(function ($injector, $location) {
// some logic
return '/foo';
});
This works exactly how I want it to except that is changes the location and appends #/foo
to the location. I don't want it appended.