Angularjs 在Ionic中未接收触摸事件数据
我正在尝试使用Ionic框架做一些相当简单的事情Angularjs 在Ionic中未接收触摸事件数据,angularjs,ionic-framework,touch,dom-events,Angularjs,Ionic Framework,Touch,Dom Events,我正在尝试使用Ionic框架做一些相当简单的事情 <form> <div class="list"> <div> <img ng-src="some_image_source"></img> </div> <label class="item item-input"> <input type="text" placeholder="What do you need to do
<form>
<div class="list">
<div>
<img ng-src="some_image_source"></img>
</div>
<label class="item item-input">
<input type="text" placeholder="What do you need to do?" ng-model="task.title">
</label>
</div>
<div class="padding">
<button on-touch="beginInterest(event)" class="button button-block button-positive">Create Task</button>
</div>
我在这里做错了什么吗?您需要删除
type=“submit”
创建任务
我认为您需要执行ng touch=“beginInterest($event)”
并且需要加载angular touch.js
并在应用程序依赖项上设置ngTouch
(例如angular.module('myApp',['ngTouch'])
。此处的文档:不幸的是,这没有帮助。我已经更新了上面表单的html。如果您有其他信息,请告诉我。我希望通过Ionic的on touch指令实现这一点。
$scope.beginInterest = function (event) {
// But there is no event object here! It's undefined.
}
<button on-touch="beginInterest()" class="button button-block button-positive">Create Task</button>