我正在尝试用angularjs和ionic清除ionic模式文本字段上的文本,这是我的尝试:
<label class="item item-input">
<textarea ng-model="content" rows="5" placeholder="write something"></textarea>
</label>这是要关闭的按钮
<button style="border: 3px solid red; border-radius:5px; color: #ff6000" class="button button-clear button-positive" ng-click="clearContent(); close()">Close</button>这是清除文本的作用域函数
//clear the content of the text field
$scope.clearContent = function() {
$scope.content = '';
};当我单击close按钮时,没有任何反应。一切似乎都很好,但不知道哪里出了问题。
发布于 2015-10-28 16:21:19
请尝试以下操作:
HTML
<button style="border: 3px solid red; border-radius:5px; color: #ff6000" class="button button-clear button-positive" ng-click="clearContent()">Close</button>JS
$scope.clearContent = function() {
$scope.content = '';
$scope.close();
};
$scope.close=function(){
//close will be here
}https://stackoverflow.com/questions/33385883
复制相似问题