Change this:
element.bind('blur', function (e) {
scope.nr = scope.nr * 2;
document.getElementById('watch').innerHTML = scope.nr;
});
To this:
element.bind('blur', function (e) {
scope.$apply(function() {
scope.nr = scope.nr * 2;
});
document.getElementById('watch').innerHTML = scope.nr;
});
Adrian
On 24 November 2014 at 13:03, trzczy <[email protected]> wrote:
> Could you please help me with angular code. The directive has to double
> increase the value in the textarea but it doesn't. It changes only the text
> in div that is placed below. But the text in the textarea should be updated
> too. So both numbers should be the same. To run the directive one has to
> click inside the textarea and then click somewhere outside the textarea.
> That is the code: jsfiddle <http://jsfiddle.net/9mFpp/814/> that does not
> work.
> Thanks in advance
>
> --
> You received this message because you are subscribed to the Google Groups
> "AngularJS" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> Visit this group at http://groups.google.com/group/angular.
> For more options, visit https://groups.google.com/d/optout.
>
--
You received this message because you are subscribed to the Google Groups
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.