Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ember, update form value using jquery

I have an ember app where I show a bootstrap popover. From that popover, there is a little form that should update the value of a textarea which is bound to a model. If I type in the textarea, the binding to the model works fine. However, I if I use jquery (like below) to update the value of the text area, the ember binding will not see the change in the model. Is this even possible?

$("#myBoundTextArea").val("blah");
like image 507
Ben Avatar asked Apr 30 '13 00:04

Ben


1 Answers

You can trigger the change, using jquery, which also will notify ember binding.

This is done as such

$("#myBoundTextArea").trigger("change");
like image 130
MartinElvar Avatar answered Oct 15 '22 10:10

MartinElvar