0

I have routes setup as shown below. could someone please help understand what does '' & '/' mean when it comes to routing..

Route configuration below;

$urlRouterProvider.when('', function ($state) {
    $state.go('login');
});

$urlRouterProvider.when('/', function ($state) {
    $state.go('login');
});
blogs4t
  • 2,329
  • 5
  • 20
  • 33

2 Answers2

0

It tells how ui-view should change when your $location/url is changed (user clicked <a href="/login">). Your template must contain at least one element that has ui-view attribute. Using $state.go('login') will active the login state, which changes your ui-view etc. For more information, check URL-Routing

Zen
  • 5,065
  • 8
  • 29
  • 49
0

Those are the hashed part of the url, it is for routing, say if you type the url http://localhost/#/ or http://localhost/# it has to go to login page, that is what you are doing there, it will go the state associated with the mapped url.

Kiran Kumar
  • 1,033
  • 7
  • 20