Kevin Vincent
Kevin Vincent

Reputation: 617

Update ng-model in a textarea when the value change in a function

I have this issue :

<textarea ng-model="modelToUpdate" rows="4" cols="50">

And when i do this in a called function in my script :

$scope.modelToUpdate = "test"

I'd like to see the changement directly in the textarea.

Upvotes: 0

Views: 358

Answers (1)

Alok
Alok

Reputation: 1310

Are you closing down the textarea tag ??

<body ng-controller="MyCtrl" class="container">
  <textarea ng-model="modelToUpdate" rows="4" cols="50"></textarea>
</body>

See the plunker below for more information.

https://plnkr.co/edit/u6kcu9JUTGZ74f4VJDxT

Upvotes: 2

Related Questions