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
を、それをチェックアウトし、角度1.1.4での作業あなたの例でplunkerを作りました。問題はバージョンで発生する可能性があります。 – Chandermani