angularjs - Error: [$injector:modulerr] Failed to instantiate module customerApp due to: Error: [$injector:unpr] Unknown provider: $routeProvider -


i'm getting error "unknown provider: $routeprovider" though have ngroute dependency , have included angular-route.js in html files

var customerappmodule = angular.module("customerapp", ['ngroute']); customerappmodule.config(['$routeprovider',     function ($routeprovider) {         $routeprovider.             when('/mainmenu', {                 templateurl: 'home/mainmenu.html',                 controller: 'checkctrl'             }).             when('/index', {                 templateurl: 'home/index.html',                 controller: 'mainctrl'             }).             otherwise({                 redirectto: '/mainmenu'             });     }]); 

usually error appears when angular-route.js not loaded reason.

the said project has mismatched versions angular , module:

<script data-require="angular.js@1.4.0-beta.6" data-semver="1.4.0-beta.6" src="https://code.angularjs.org/1.4.0-beta.6/angular.js"></script> <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.4/angular-route.js"></script> 

this can result in injector failure produce other errors.


Comments

Popular posts from this blog

python - Operations inside variables -

Generic Map Parameter java -

arrays - What causes a java.lang.ArrayIndexOutOfBoundsException and how do I prevent it? -