Cannot get textarea value in angularjs

前端 未结 4 1011
一生所求
一生所求 2020-12-02 15:36

Here is my plnkr: http://plnkr.co/edit/n8cRXwIpHJw3jUpL8PX5?p=preview You have to click on a li element and the form will appear. Enter a random string and hit \'add notice\

4条回答
  •  一向
    一向 (楼主)
    2020-12-02 15:56

    It is, indeed, ui-if that creates the problem. Angular if directives destroy and recreate portions of the dom tree based on the expression. This is was creates the new scope and not the textarea directive as marandus suggested.

    Here's a post on the differences between ngIf and ngShow that describes this well—what is the difference between ng-if and ng-show/ng-hide.

提交回复
热议问题