2014-12-11 2 views
0

Есть ли кто-нибудь знает, почему я получил следующий вопрос:angularJS не удалось загрузить модуль

Uncaught Error: [$injector:modulerr] http://errors.angularjs.org/1.3.6/ $injector/modulerr?p0=helloKinveyApp&p1=E…ogleapis.com%2Fajax%2Flibs%2Fangularjs%2F1.3.6%2Fangular.min.js%3A17%3A350)angular.min.js:6 (anonymous function)angular.min.js:36 (anonymous function)angular.min.js:7 rangular.min.js:35 gangular.min.js:38 Obangular.min.js:17 dangular.min.js:18 scangular.min.js:16 Hdangular.min.js:249 (anonymous function)angular.min.js:163 aangular.min.js:32 c

var app = angular.module("helloKinveyApp", ["ngRoute", "kinvey"]); 

app.run(["$kinvey", function($kinvey) { 
    var promise = $kinvey.init({ 
     appKey: clientParams.appKey 
     , appSecret: clientParams.appSecret 
    }); 

    promise.then(function() { 
     console.log("Kinvey init with success"); 
    }, function(errorCallback) { 
     console.log("Kinvey init with error: " + JSON.stringify(errorCallback)); 
    }); 
}]); 

<!DOCTYPE html> 
<html data-ng-app="helloKinveyApp"> 
    <head> 
     <title>Hello Kinvey Lesson 1</title> 
    </head> 
    <body> 
     <div data-ng-view="" /> 
     <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.3.6/angular.min.js"></script> 
     <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.3.6/angular-route.min.js"></script> 
     <script src="https://da189i1jfloii.cloudfront.net/js/kinvey-angular-1.1.4.min.js"></script> 
    </body> 
</html> 
+0

использование без уменьшенная версия углового, вы получите более подробную информацию о проблеме – harishr

+0

В каком разделе приложения является следующая строка находится 'вар приложение = angular.module («helloKinveyApp» , ["ngRoute", " kinvey "]);'? –

+0

И что здесь делает _jQuery_ тэг? – Regent

ответ

0

Если ваш код был структурирован таким же образом, как показано ниже, он должен работать (т.е. вы должны получить ошибка загрузки модуля):

... 
<body> 
    ... 
    <div data-ng-view="" /> 
    <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.3.6/angular.min.js"> 
    </script> 
    <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.3.6/angular-route.min.js"> 
    </script> 
    <script src="https://da189i1jfloii.cloudfront.net/js/kinvey-angular-1.1.4.min.js"> 
    </script> 
    ... 
    <script> 
     var app = angular.module("helloKinveyApp", ["ngRoute", "kinvey"]); 

     app.run(["$kinvey", function($kinvey) { 
      var promise = $kinvey.init({ 
       appKey: clientParams.appKey, 
       appSecret: clientParams.appSecret 
      }); 

      promise.then(function() { 
       console.log("Kinvey init with success"); 
      }, function(errorCallback) { 
       console.log("Kinvey init with error: " + JSON.stringify(errorCallback)); 
      }); 
     }]); 
    </script> 
</body> 
+0

Я забыл ссылаться на app.js в index.html – newbie

+0

, так что это все. И он должен быть ниже углового и кинве, поскольку он зависит от них обоих. Положитесь на последнее, и ваши проблемы должны быть решены. –

+0

Не забудьте выбрать это как ответ, если это поможет исправить вашу проблему. –