0

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?

3
  • 1
    you removed the restangular module and you are confused why Angular can't find it anymore? Commented Sep 13, 2016 at 11:01
  • full error trace might also help Commented Sep 13, 2016 at 11:21
  • i added full error trace Commented Sep 13, 2016 at 11:44

1 Answer 1

0

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...

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.