Angular Routing using ngRoute
This example shows setting up a small application with 3 routes, each with it's own view and controller, using the controllerAs syntax.
We configure our router at the angular .config function
1. We inject $routeProvider into .config
2. We define our route names at the .when method with a route definition object.
3. We supply the .when method with an object specifying our template or templateUrl, controller and controllerAs
Then in our HTML we define our navigation using elements with href, for a route name of helloRoute we will route as My route
We also provide our view with a container and the directive ng-view to inject our routes.