Created
March 8, 2015 16:47
-
-
Save andrewconnell/b67b7d6396f018cf60bf to your computer and use it in GitHub Desktop.
ADAL JS + Angular: Loading the Routes
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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