javascript - AngularJS: Update template binding via directive -
I have modified AngularUI-Bootstrap direvtive for tooltips to help display error messages, here it is I've done so far:
But I have a problem with dynamic messages. The first time you mousewish the first input field, the message is in the wrong place, that's because the model has not been updated correctly yet. Of course, the tooltip is in the right place after the second mouseover. But if the message fails again to display the changes.
I am using It seems that all the listeners have not updated again and the correct updates of messages / models are set to "$ ttHeight" and "ttWidth" are still set to "old" values only $ Works with inspection, which is explained by the third example. I am stuck and I do not know what I did wrong? : The problem is that when you modify your model with $, you should manually Activate the digest cycle. So basically, you need to add the scope. $ Digest (); whenever you change the scope of doing things like scope; $ Apply (show); I modified your code here with my suggestions $ parse to update the template:
$ parse ('Tt_content'). Assign (scope, getErrorMessage (ctrl. $ Error) || attrs.tooltip);
Comments
Post a Comment