I\'m trying to store the value of a contenteditable
to my JS code. But I can\'t find out why ng-model
doesn\'t work in this case.
&
Neither of the other answers worked for me. I needed the model's initial value to be rendered when the control was initialized. Instead of calling read()
, I used this code inside the link
function:
ngModel.$modelValue = scope.$eval(attrs.ngModel);
ngModel.$setViewValue(ngModel.$modelValue);
ngModel.$render()