我是移动开发的新手,正在尝试逐步开发应用程序。
在服务器启动时,页面空白,如果有完整的应用程序,则带有箭头和单词“ back”。
任何想法如何测试或从哪里可以观察到错误?非常感谢!
更新:
这是我在开发人员工具(控制台)中看到的
加载资源失败:服务器响应状态为404(未找到)
local@cordova.js
加载资源失败:服务器响应状态为404(未找到)
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();
};
})
..of这是视图文件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>
最佳答案
我解决了事实证明,我放置电子邮件控制器的位置应该在所有作用域之外的最后。