chinmaymk/angular-charts

Error the moment I add angular.module('app',['angularCharts']) to my module.

Opened this issue · 2 comments

Uncaught Error: [$injector:modulerr] Failed to instantiate module yoangfull2App due to:
Error: [$injector:unpr] Unknown provider: $routeProvider
http://errors.angularjs.org/1.3.12/$injector/unpr?p0=%24routeProvider
    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)

Here is my code

angular.module('yoangfull2App',['angularCharts'])
  .config(function ($routeProvider) {
    $routeProvider
      .when('/archives', {
        templateUrl: 'app/archives/archives.html',
        controller: 'ArchivesCtrl'
      });
  });
 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.