Search code examples
angularjsvalidationangularjs-directiveangular-directiveangularjs-digest

view is not getting refreshed with updated model


My angular view is not getting updated when model changes. Model is getting changed in "onblur" event in directive.

inputNgEl.bind('blur', function () { })

My model is being passed to a directive and directive is displaying the content of the model.

Please find the plunk below. http://plnkr.co/edit/Ku5yOyWsa1fjnLIs2Eu3?p=preview

Can you please advise what is missing here? Thanks.


Solution

  • following change worked for me.

    inputNgEl.bind('blur', function () { $timeout(function () { scope.$apply(ValidateControl); }, 0, false); });

    Corrected plunk http://plnkr.co/edit/kSnZbgY5AiaSfQxjbQke?p=preview