In services.js
/* Controllers */
function DailyTipController($scope, $http, $configService) {
// $http.get('')
$scope.tip = $configService.version;
}
So far so good right? Nope. When I run my app, this is what I got:
Error: Unknown provider: $configServiceProvider <- anonymous="" at="" configservice="" error="">) at ->file:///home/tchan/repo/codetipdaily/public/client/app/lib/angular/angular.js:2641:15 at Object.getService [as get]
Alright...what's happening here?
I went through the documentation and found that in addition to registering the the controller, you also need to inject the controller with the right parameters:
In controllers.js
DailyTipController.$inject = ['$scope','$http', 'configService'];
No comments:
Post a Comment