如何testing或排除故障? node.js上的ionic framework(带有Angular.js)
我新的移动开发,并试图按照一步一步的应用程序。
服务器启动时页面空白,箭头和“回”字应该是一个完整的应用程序。
任何想法如何testing或我可以从哪里观察错误? 非常感谢!
更新:
这是我在开发人员工具(控制台)
-
加载资源失败:服务器响应状态为404(未find)
local@cordova.js
-
加载资源失败:服务器响应状态为404(未find)
local@js/services.js
-
未捕获的SyntaxError:意外的令牌。 controllers.js:171
-
未捕获错误[$ injector:modulerr]由于以下原因无法实例化模块bucketList:错误:[$ injector:modulerr]
-
由于以下原因无法实例化模块bucketList.controllers:错误:[$ injector:nomod]模块“bucketList.controllers”不可用…… 1)
另外,用Jasmine运行Testem还给出了下面的错误:
-
在app.js的第1行中没有定义Angular,它是以下代码:
angular.module('bucketList',['ionic','firebase','bucketList.controllers'))
它的东西在这里提到的依赖关系: https : //docs.angularjs.org/guide/di
但我无法挑出错误的关系…
更新2: controllers.js:171引用此块行的第一行
.controller('newCtrl', function($rootScope, $scope, $window, $firebase) { $scope.data = { item: "" }; $scope.close = function() { $scope.modal.hide(); }; $scope.createNew = function() { var item = this.data.item; if (!item) return; $scope.modal.hide(); $rootScope.show(); $rootScope.show("Please wait... Creating new"); var form = { item: item, isCompleted: false, created: Date.now(), updated: Date.now() }; var bucketListRef = new Firebase($rootScope.baseUrl + escapeEmailAddress($rootScope.userEmail)); $firebase(bucketListRef).$add(form); $rootScope.hide(); }; })
..其中这是查看文件的HTML。
<div class="modal slide-in-up" ng-controller="newCtrl"> <header class="bar bar-header bar-secondary"> <button class="button button-clear button-primary" ng-click="close()">Cancel</button> <h1 class="title">New Item</h1> <button class="button button-positive" ng-click="createNew()">Done</button> </header> <ion-content class="padding has-header"> <input type="text" placeholder="I need to do..." ng-model="data.item"> </ion-content> </div>
我解决了它。 事实certificate,我的电子邮件控制器应放在所有范围之外。