Reputation: 50
I have change the value input of my dom element using jquery code in materialize js plugin :
$input.val($(this).attr('id').trim());
I am not getting the ng-model
value in my controller, but getting value in POST
form.
I need the implicit value on input value change.
How can I achieve this.
Please advice using the code.
Upvotes: 1
Views: 46
Reputation: 10740
Just run
$scope.$apply();
after changing the value... to start the $digest
cycle.
After changing the value outside of angular scope you need to bring the changes to angular...
Upvotes: 2