Reputation: 498
I have problem with my textarea.
When I want clear her with ng-click, nothing happens ...
Can you help me ?
This is my code, you can test with Jsfiddle : My app
If you prefer see it here :
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;
}
}
Thank for help !
Upvotes: 1
Views: 407
Reputation: 136144
Change ==
(equality operator) to =
(assignment operator) in ng-click
isWriting == ''
to
isWriting = ''
Upvotes: 2