I am trying to create a sample Angular app with .Net, just to get the idea how to connect two of them but I can not get rid of this injector::modulerr error. Tried variety of things, changing dependencies, removing empty brackets and so on but nothing changes. I have created plunker to keep this thread cleaner the link is below.
http://plnkr.co/edit/5AHsUSrFib4dkiX6XjLY?p=preview
I think the error keeps coming from this one
angular.module('angularTest', ['ngRoute']).config(['$routeProvider', '$routeParams', '$httpProvider',
function ($routeProvider, $routeParams, $httpProvider) {
console.log('1');
$routeProvider.
when('/routeOne', {
templateUrl: 'routesDemo/one'
})
.when('/routeTwo/:donuts', {
templateUrl: function (params) { return '/routesDemo/two?donuts=' + params.donuts }
})
.when('/routeThree', {
templateUrl: 'routesDemo/three'
})
.when('/login?returnUrl', {
templateUrl: '/Account/Login',
controller: LoginController
});
console.log('2');
$httpProvider.interceptors.push('AuthHttpResponseInterceptor');
}
]);
Thanks for your time.
$routeParamsshould be post fix withProvideras you can only use provider in config phase.Also you should always define app only once then append it by using that module, recreating
angular.modulewill flush the old app & new copy will treated as that module. In you service & controller you need to make change fromangular.module('angularTest',[])toangular.module('angularTest')Additionally you missed to add
'onLogInControllerOne last thing, you missed to add
AuthHttpResponseInterceptor.jswhich was not recognize by the angular app and was throwingAuthHttpResponseInterceptorfactory not defined.Working Plunkr