I'am trying to use a basic sample of interceptors, so I stared with a little piece of code but without success:
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');
});
When I launch my index page I have an error message in the console :
Uncaught TypeError: Cannot call method 'push' of undefined from app
Any idea?
Thanks