snapjay / ngCart

Really simple shopping cart for AngularJS
http://ngcart.snapjay.com
380 stars 236 forks source link

Unknown provider: ngCartProvider #81

Closed stcalica closed 7 years ago

stcalica commented 7 years ago

issue: Unknown provider: ngCartProvider <- ngCart <- mainController

I have no idea why this is happening. I'm starting to think this is outdated and it doesn't seem like he or anyone else supports this project anymore. Because of Angular2 perhaps?

  var dependencies = [
                      'ngRoute',
                      'ngCart'
                    ];

  angular.module('test', dependencies).config(Config);

  Config.$inject = [ '$locationProvider', 'ngCartProvider'];
  angular.module('test').controller('mainController', mainController);

  mainController.$inject = [ '$scope', '$http', 'ngCart' ];

  function mainController( $scope, $http, ngCart){
     //inside controler
  }
  <script type="text/javascript" src="/libraries/angular/angular.min.js"></script>
  <script type="text/javascript" src="/libraries/angular-route/angular-route.min.js"></script>
  <script type="text/javascript" src="/libraries/ngCart/dist/ngCart.js"></script>

  <script type="text/javascript" src="/app.js"></script>
  <script type="text/javascript" src="/module/config/test.client.routes.js"></script>

  <script type="text/javascript" src="/module/controllers/test.client.main.js"></script>
stcalica commented 7 years ago

finally found it. accidentally had two app.js files!