Asqan Asqan - 1 year ago 288
Javascript Question

Error: [$injector:unpr] Unknown provider: RestangularProvider <- Restangular <- ctrlAG

I have one app:


angular.module('AngApp', [

My own restangular service.js:

var app = angular.module('AngApp');
app.factory('restService', ['Restangular', function (Restangular) {
// make use of Restangular

and controller.js:

var app = angular.module('AngApp');
app.controller('ctrlAG', ['$scope', '$http', '$log', '$mdDialog',
'Restangular',function ($scope,$http, $log, $mdDialog, Restangular) {
// make use of other modules and Restservice


html is:

<script type="text/javascript" src="ng/app.js"></script>
<script type="text/javascript" src="ng/restangular.js"></script>
<script type="text/javascript" src="ng/restService.js"></script>
<script type="text/javascript" src="ng/ctrlAG.js"></script>
<script type="text/javascript" src="ng/ctrlMetadata.js"></script>

angular 1.3.6 , restangular (latest).

What is the reason that i take this error? I Have checked the commonly taken mistakes from here
but non of them exists.

Answer Source

You didn't inject module of Restangular service.

Try like this

angular.module('AngApp', ['angularGrid','restangular']);
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download