Linked Questions
11 questions linked to/from Otherwise on StateProvider
0 votes
1 answer
51 views
Angular 1.6 - use state to redirect from wrong url to 404 page [duplicate]
How to redirect user from wrong url to 404 page in Angular 1.6 using $state? .state('404', { url: '/404', template: '<page-404></page-404>', ncyBreadcrumb: { label: '404'...
19 votes
6 answers
51k views
Default route for angular ui router
The sample demo of the angular ui router has this link for the start page: full url of 'ui-router' is / or http://angular-ui.github.io/ui-router/sample/#/ full url of 'about' is /about or http://...
5 votes
1 answer
14k views
ui-router's $urlRouterProvider.otherwise with HTML5 Mode
Consider the following slightly modified code from ui-router's wiki. var myApp = angular.module('myApp',['ui.router']); myApp.config(function($stateProvider, $urlRouterProvider, $locationProvider) { ...
3 votes
2 answers
1k views
AngularJS force app to start from specific URL
I have a specific logic sequence in my app, and I want a simple way to force my app to start from the welcome page. I am using this: $urlRouterProvider.otherwise('/pages/welcome'); the problem is ...
3 votes
1 answer
2k views
Catch any urls using angularjs ui-router
I am using Agularjs and ui-router in my application. I need to catch all urls except "signin" & "/" . All the urls must go to a state. For example, the urls will be like www.example.com/ // ...
0 votes
1 answer
1k views
$urlRouterProvider.otherwise is not a function
I have this app.js file angular.module('myApp', [ 'myApp.version', 'ui.router' ]). config(['$locationProvider','$urlRouterProvider','$stateProvider', function($locationProvider,$...
0 votes
1 answer
1k views
How to use $urlRouterProvider.otherwise in angular js
I want to redirect to the login screen when no UABGlobalAdminId in my storage else home screen and for that, I used $urlRouterProvider.otherwise but it's not working fine.When I try debugging the ...
0 votes
2 answers
532 views
$urlRouterProvider $stateProvider otherwise does not work
Hi below is my code for urlRouterProvider otherwise. .config(function config($urlRouterProvider, $stateProvider) { $urlRouterProvider.otherwise('/invalid'); $stateProvider.state('view', { url: '/...
2 votes
3 answers
457 views
How to redirect user to default url
I'm using angular-ui-router with HTML5 mode set to false - I use hashbang. When user hits mydomain.com I need to redirect him to mydomain.com/#/welcome, how can I do that? I've looked through ui-...
0 votes
1 answer
693 views
Is it possible to set initial state and otherwise state using ui-router?
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 (...
0 votes
0 answers
383 views
UI-Router: listening to locationChangeSuccess with otherwise function causes infinite digest
I've got an angular application that uses a manually bootstrap so we can load in dependencies before the application starts. This application uses UI-router as well. Seems as though that when we ...