O'Reilly logo

Mastering AngularJS for .NET Developers by Mohammad Wadood Majid, Golrokh Mirzaei

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Securing applications

AngularJS is an inclusive JavaScript framework for SPA development. The AngularJS framework provides excellent features, such as two-way binding, directives, and so on. To secure the client-side SPA, AngularJS provides $routeProvider. $routeProvider is an AngularJS built-in service, which is a singleton object created by a service factory. $routeProvider provides two functions, .when() and .otherwise(), which are used to define the routing for an SPA. The following code syntax shows how to add routing to the SPA AngularJS application:

var app = angular.model('myApp',[]); app .config(['$routeProvider', function($routeProvider) { $routeProvider .when('/login', { templateUrl: 'myTemplates/loginSink.html', data:{ authorizedRoles: ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required