Showing posts with label $routeProvider. Show all posts
Showing posts with label $routeProvider. Show all posts

Tuesday, July 7, 2015

$routeProvider service in AngularJS

The $routeProvider service plays an important role in enabling MVC framework in AngularJS, the $routeProvider allows us to define various routes and the view template to be bound to each of the route, additionally it also allows us to define the controller to be associated with each of the route/view. This way each of the embedded templates will be fully functional with each one having its own controller.

In the following example we shall see on how to implement Routing in AngularJS using $routeProvider