-
Notifications
You must be signed in to change notification settings - Fork 27.4k
Cannot override model.$render method in directive's link function (plnkr included) #4560
Comments
update issue with plunker example |
A simple fix is to add a positive priority in tinymce directive. In case you want to know more |
Try to add a positive priority in my directive & it works, $render works as normal! Read your article too. |
Saved me a day. thanks |
Here is the cause of this: It is overriding custom The bug is sensitive to directive name, for example if your directive is called Workaround 1Set Workaround 2Use $viewchangelisteners instead of $render, for example: ngModelController.$viewChangelisteners.push(function(){
console.log('The new value is', ngModelController.$modelValue);
}); |
You could also decorate the input directive, I believe, and wrap the original link function with another |
I think we can close this, as there are numerous workarounds for this. Another one I can think of in this special case is a formatter, that displays the date in the correct format. |
My directive for jquery mobiscroll run very well on AngularJS 1.1.5.
After upgrading to 1.2 rc3, it does not work any more.
I put a break point inside $render method but angular not run into these statements.
I did a downgrade to 1.2 rc2 and it works fine.
Here are 2 version of my example:
angular 1.2 rc2 (work as expected)
http://plnkr.co/edit/gmef5FKzVRNz0syonddf?p=preview
angular 1.2 rc3 version
http://plnkr.co/edit/8GvWoU1yKI14Joi3VMhn?p=preview
The text was updated successfully, but these errors were encountered: