正在浏览离子教程,并创建了一个带有一些文本字段的弹出窗口的应用程序,它可以工作,但按下时ok按钮不执行任何操作,它应该将填充的数据发送到我的Parse数据库,但不会吨。我已经多次查看代码,但不确定我做错了什么。这是我的js file with the function in question和我对应的index.html。我认为错误在friend.save中,因为错误日志显示personEmail,personContact等问题,但不确定如何解决它。 (请注意:这个/开发很新。)
JS档案:
$scope.showAddPopup : function () {
var myPopup : $ionicPopup.sbow({
template : '<input type= "text" placebolder="Name" ng-model="new.personName"/><br/>
<input type= "text" placeholder="Phone" ng-model="new.personContact"/><br/>
<input type: "text" placeholder="Email" ng-model="new.personEmail"/><br/>
<input type= "text" placeholder="Display Picture URL" ng-model="new.personDisplayPicture"/>'.
title : 'Enter Details',
subtitle : '',
scope : $scope,
buttons : [{
text : 'Cancel'
}, {
text : 'OK',
type : 'button-assertive',
onTap : function (e) {
var newFriend = Parse.object.extend('friendslist');
var friend = new newFriend();
friend.save({
personName: $scope.new.personNane,
personEmail: $scope.new.personEnail,
personContact: $scope.new.personContact,
personDisplayPicture: $scope.new.personDisplayPicture
}).then(function (object) {
$ionicPopup.alert({
title : 'Friend Added',
template : 'Friend has been successfully added to the list.’
});
})
}
}]
});
}