0

アプリでAngularを使用して承認を試みます。app.service を作成し、「Restangular」を注入しました。そして、私はこのエラーがあります

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.

HTMLページにすべてのファイルを含めました

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"

これは私のアプリコードです

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

Ant これは AuthService です。

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

誰か助けてくれませんか?何が問題なの?

4

1 に答える 1

0

プロジェクトモジュールにサードパーティモジュールを挿入するときは、モジュール名をパラメーターとして送信する必要があります...

あなたの場合、restangular のモジュール名ではないRestangularを注入していますが、それをrestangularに変更すると問題ありません...

Restangular はモジュールではなくサービスの名前です...

于 2016-09-16T20:06:32.383 に答える