I'm setting the initial state when first entering the app with a simple condition (i'm fully aware it also prevents deep linking .. thats OK).
.run(function($state, browserFactory) {
if (browserFactory.isSupported()) {
$state.go('browser-unsupported');
} else {
$state.go('welcome');
}
}
This is working fine.
But, if I set an otherwise
rule it will always follow that rule. For example, if I set
.config(function($urlRouterProvider) {
$urlRouterProvider.otherwise('/welcome');
}
It will always end up at /welcome
.
Is there any way around it or maybe a better way to set an initial route based on a condition and have an otherwise
rule?