Anwin
Anwin

Reputation: 71

"Restangular" Error: $injector:modulerr Module Error

I try to make authorization in my app with angular. I created app.service and injected "Restangular". And i have this error

Error: $injector:modulerr Module Error Failed to instantiate module cadastral due to:
Error: $injector:modulerr Module Error Failed to instantiate module Restangular due to:
Error: $injector:nomod Module Unavailable Module 'Restangular' is not available! You either misspelled the module name or forgot to load it. If registering a module ensure that you specify the dependencies as the second argument.

I included all files in my html page

script src="/app/app/core/js/angular.js" type="text/javascript"
scrip src="/app/app/core/js/angular-resource.js" type="text/javascript"
script src="/app/app/core/js/angular-route.js" type="text/javascript"
script src="/app/app/core/js/restangular.js" type="text/javascript"

This is my app code

var app = angular.module('cadastral', ["ngRoute","ngResource",'ngCookies',"Restangular"]);
app.controller('authCtrl', function($scope,$http,$routeParams,AuthService,$cookies){
  /**/
});

Ant this is AuthService:

app.service('AuthService', function($cookies, $http, Restangular) {
/**/
  });

Can somebody help me? what's problem?

Upvotes: 0

Views: 346

Answers (1)

Poyraz Yilmaz
Poyraz Yilmaz

Reputation: 5857

when you inject a third party module into your project module you should send module name as parameter...

In your case you are injecting Restangular which is not the module name for restangular change it to restangular and you should be fine...

Restangular is the name of its service not module...

Upvotes: 0

Related Questions