Open rohanshar opened 9 years ago
Uncaught Error: [$injector:modulerr] Failed to instantiate module testfullApp due to:
Error: [$injector:unpr] Unknown provider: $stateProvider
http://errors.angularjs.org/1.3.13/$injector/unpr?p0=%24stateProvider
at REGEX_STRING_REGEXP (http://localhost:9000/bower_components/angular/angular.js:63:12)
at http://localhost:9000/bower_components/angular/angular.js:3997:19
at getService (http://localhost:9000/bower_components/angular/angular.js:4144:39)
at Object.invoke (http://localhost:9000/bower_components/angular/angular.js:4176:13)
at runInvokeQueue (http://localhost:9000/bower_components/angular/angular.js:4091:35)
at http://localhost:9000/bower_components/angular/angular.js:4100:11
at forEach (http://localhost:9000/bower_components/angular/angular.js:323:20)
at loadModules (http://localhost:9000/bower_components/angular/angular.js:4081:5)
at createInjector (http://localhost:9000/bower_components/angular/angular.js:4007:11)
at doBootstrap (http://localhost:9000/bower_components/angular/angular.js:1445:20)
http://errors.angularjs.org/1.3.13/$injector/modulerr?p0=testfullApp&p1=Err…
Code
'use strict';
angular.module('testfullApp',['angularCharts'])
.config(function ($stateProvider) {
$stateProvider
.state('main', {
url: '/',
templateUrl: 'app/main/main.html',
controller: 'MainCtrl'
});
});
Hi, I'm random guy browsing issues here.
On the error message, you can observe the fragment Unknown provider: $routeProvider
. $routeProvider
is a ui-router
component. You may be have taken too literally the config section of the docs.
try with:
angular.module('testfullApp',['ui.router','angularCharts'])
.config(function ($stateProvider) {
$stateProvider
.state('main', {
url: '/',
templateUrl: 'app/main/main.html',
controller: 'MainCtrl'
});
});
as you see, the second argument of the angular.module
call is a list of all the dependencies you have.
Here is my code