concept ngRoute in category angular

appears as: ngRoute, ngRoute
AngularJS in Action

This is an excerpt from Manning's book AngularJS in Action.

With the modules in place, the next step is to set up the ability to navigate from one feature to another. We’ll start out with ngRoute, since it’s incredibly simple (albeit limited) to implement within an application.

Figure 7.1. ngRoute big picture
Table 7.1. ngRoute components

Component

Responsibility

$routeProvider Configures routes
$route Listens to URL changes and coordinates with the ng-view instance
ng-view Responsible for coordinating the creation of the appropriate controller and view for the current route
$routeParams Interprets and communicates URL parameters to the controller

7.2.1. Create your first route with ngRoute and ngView

Because ngRoute isn’t part of the AngularJS core, the first thing we need to do is to include the ngRoute source file. You can download the source file directly from the AngularJS website or use the CDN or Bower to fetch the file:

sitemap

Unable to load book!

The book could not be loaded.

(try again in a couple of minutes)

manning.com homepage
test yourself with a liveTest