Tutorial by Examples

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 We inject $routeProvider into .config We define our route names at the .when method with a route defini...
This example extends the basic example passing parameters in the route in order to use them in the controller To do so we need to: Configure the parameter position and name in the route name Inject $routeParams service in our Controller app.js angular.module('myApp', ['ngRoute']) .contro...
The simplest manner of defining custom behavior for individual routes would be fairly easy. In this example we use it to authenticate a user : 1) routes.js: create a new property (like requireAuth) for any desired route angular.module('yourApp').config(['$routeProvider', function($routeProvider) ...

Page 1 of 1