我的textarea有问题。
当我想用ng-click清除她时,没有任何反应......
你能帮助我吗?
这是我的代码,您可以使用Jsfiddle进行测试:My app
如果您愿意,请点击此处:
HTML:
<div ng-controller="Ctrl1">
<div><textarea id="yourid" ng-model="isWriting" ng-change="writeEvent(isWriting)"></textarea>
<span ng-if="displaySend == 1">Yann says :</span> {{isWriting}}
<p ng-click="sendYaah(isWriting); isWriting == ''">YAH!</p>
</div>
JS:
$scope.writeEvent = function(isWriting) {
$scope.imWriting = isWriting;
var empty = "";
if ($scope.imWriting != empty){
$scope.displaySend = 1;
// $scope.waitResponse = true;
} else {
$scope.displaySend = 0;
// $scope.waitResponse = false;
}
}
感谢您的帮助!