0
我需要一定的路線來要求認證的路線,我使用這個模塊:認證的角度
https://github.com/enginous/angular-oauth
其中有$ scope.authenticate但我試圖找出如何訪問$範圍/從$ routeProvider函數。我看到一個例子調用工廠函數,但這不完全是我想要做的。
'use strict';
angular.module('app', [
'ngRoute',
'angularOauth',
'googleOauth',
'app.global',
'app.home',
'app.view'
]).
config(['$routeProvider', function($routeProvider) {
$routeProvider.when('/', {
templateUrl: 'views/home/index.html',
controller: 'home'
});
$routeProvider.when('/view', {
templateUrl: 'views/view/index.html',
controller: 'view',
resolve: {
factory: checkAuth
}
}).otherwise({redirectTo: '/'});
$routeProvider.otherwise({redirectTo: '/'});
}]);
var checkAuth = function() {
};