route Provider

Kmandapalli
Posted by Kmandapalli under AngularJS category on | Points: 40 | Views : 352
var mainApp = angular.module("mainApp", ['ngRoute']);

mainApp.config(['$routeProvider',
function($routeProvider) {
$routeProvider.
when('/addStudent', {
templateUrl: 'addStudent.htm',
controller: 'AddStudentController'
}).
when('/viewStudents', {
templateUrl: 'viewStudents.htm',
controller: 'ViewStudentsController'
}).
otherwise({
redirectTo: '/addStudent'
});
}]);

Comments or Responses

Login to post response