I'am próbuje użyć podstawową próbkę przechwytujących, więc patrzył z mały kawałek kodu, ale bez powodzenia:
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');
});
Kiedy uruchomić moją stronę indeksu Mam komunikat o błędzie w konsoli:
Uncaught TypeError: Cannot call method 'push' of undefined from app
Masz pomysł?
Dzięki
Sprawdź angularjs wersję i odpowiadającą wersję $ http dokumentacji. Problem może dotyczyć wersji. – Chandermani