O'Reilly logo

Mastering Web Application Development with AngularJS by Pawel Kozlowski, Peter Bacon Darwin

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Using built-in AngularJS routing services

The AngularJS framework has a built-in $route service that can be configured to handle route transitions in single-page web applications. It covers all the features that we were trying to handcraft using the $location service and additionally offers other very useful facilities. We are going to get familiar with those step-by-step.

Note

Starting from Version 1.2, AngularJS will have its routing system delivered in a separate file (angular-route.js) with its own module (ngRoute). When working with the latest version of AngularJS, you will need to remember to include the angular-route.js file and declare a dependency on the ngRoute module.

Basic routes definition

Before diving into more advanced usage scenarios, ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required