Thanks Michael, this did it! Now it seems that the binding is working in
both directions. I updated the Plunker accordingly. Of course, this is a
hack but I suppose/hope that once Angular 2 is released such issues should
be removed. Meantime, thanks again!
On Sunday, January 17, 2016 at 3:31:17 PM UTC+1, michael corbridge wrote:
>
> Update:
> ummmm .... that ndx is for debugging - you can get rid of it
>
> On Sunday, January 17, 2016 at 9:29:31 AM UTC-5, michael corbridge wrote:
>>
>> I see that same ...
>>
>> so I did this
>>
>> -------------------------------------------------------------------------------------------------------------------
>>
>> this.editor.on("change", (e:any) => {
>> this.ndx++;
>> if(this.ndx === 10){
>> return;
>> }
>> let s = this.editor.getValue();
>> if(s.length !== 0){ //<--------------------check the length of the string
>> sent back
>> this.textChanged.emit(s);
>> }
>> });
>>
>> -----------------------------------------------------------------
>>
>> and that seems to fix the race condition
>>
>>
>> On Sunday, January 17, 2016 at 1:36:41 AM UTC-5, Naftis wrote:
>>>
>>> Thank you, this fixed the issue, I had misinterpreted the docs when they
>>> say that the [(...)] notation is conceptually equivalent to a [...] plus a
>>> (...) notation so I thought I had not to add the event handler explicitly.
>>> Anyway, this now poses *another problem*: try *first *typing something
>>> in the editor, and *then *clicking the SET XML button: now the editor
>>> flickers in an endless loop, as the change on one side is reflected on the
>>> other side, and vice-versa, so that Angular seems stuck in a circular
>>> update. This also happens if you type something, select a part or whole the
>>> typed text, and type something else, thus replacing the selection. How
>>> could I solve this?
>>>
>>
--
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 https://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.