345611 (1) [Avatar] Offline
#1
Just a heads up - on line 5 of app.js, the line to add a default route causes the browser to lock up.

On page 71 of the book, it is listed as:
$urlRouterProvider.otherwise('/home');

And it should be:
$urlRouterProvider.otherwise('/');

Newcomers to angular might not be aware of how to fix this.
jeremy.wilken (208) [Avatar] Offline
#2
Hello,

The code behaves as expected I believe, because the home route should be assigned the url of /home. It should match what is in the book, unless you have something else to show that demonstrates this exactly?

  $stateProvider
    .state('home', {
      url: '/home',
      templateUrl: 'views/home/home.html'
    });
  
  $urlRouterProvider.otherwise('/home');


Putting otherwise('/') would redirect to an invalid route, which causes problems. Later in the chapter the otherwise() value is updated to a different view, but I just ran the example here and it worked as expected. Please share your exact code if there is a difference from what is in the book or GitHub project.