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

ubuntu - PHP script to find files of certain extensions in a directory, returns populated array when run in browser, but empty array when run from terminal -

php - How can i create a user dashboard -

javascript - How to detect toggling of the fullscreen-toolbar in jQuery Mobile? -