Skip to content

Instantly share code, notes, and snippets.

@andrewconnell
Created March 8, 2015 16:47
Show Gist options
  • Select an option

  • Save andrewconnell/b67b7d6396f018cf60bf to your computer and use it in GitHub Desktop.

Select an option

Save andrewconnell/b67b7d6396f018cf60bf to your computer and use it in GitHub Desktop.
ADAL JS + Angular: Loading the Routes
module adalO365CorsClient {
'use strict';
export class Routes {
/**
* Configures the routes for the application.
* @param $routeProvider
*/
static configure($routeProvider:ng.route.IRouteProvider):void {
var baseUrl = 'app/';
$routeProvider
.when('/', <shared.INavRoute>{
templateUrl: baseUrl + 'layout/dashboard.html',
requireADLogin: false, // unnecessary as default = false
showInNav: false
})
.when('/login', <shared.INavRoute>{
title: 'Login',
requireADLogin: true,
showInNav: true
})
.when('/lists', <shared.INavRoute>{
title: 'SharePoint Online REST API',
controller: 'adalO365CorsClient.listsController',
templateUrl: baseUrl + 'lists/lists.html',
controllerAs: 'vm',
requireADLogin: true,
showInNav: true
})
.when('/files', <shared.INavRoute>{
title: 'Office 365 Files REST API',
controller: 'adalO365CorsClient.filesController',
templateUrl: baseUrl + 'files/files.html',
controllerAs: 'vm',
requireADLogin: true,
showInNav: true
})
.otherwise({redirectTo: '/'});
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment