I'am 인터셉터의 기본 샘플을 사용하려고, 그래서 나는 코드의 작은 조각으로하지만 성공하지 보았다 :
var app = angular.module('app',[]).
config(['$routeProvider','$locationProvider', function($routeProvider,$location) {
$routeProvider.
when('/home', {templateUrl: 'home.html', controller: homeCtrl}).
when('/login', {templateUrl: 'login.html', controller: loginController}).
otherwise({redirectTo : '/home' });
}]);
app.config(function ($httpProvider) {
$httpProvider.interceptors.push('httpRequestInterceptor');
});
내 인덱스 페이지를 실행하면 나는 오류 메시지가 콘솔의 경우 :
Uncaught TypeError: Cannot call method 'push' of undefined from app
어떤 생각?
을 확인하여 AngularJS와 버전과 $의 해당 버전 HTTP 설명서를 참조하십시오. 버전과 함께 문제가 발생할 수 있습니다. – Chandermani