Hi Patrick,

I noticed your plunker after your response :) You are right, the 
getElementById is not bound to the nativeElement. I'm not sure why not, but 
I currently lack the time to dig into that one.
this will work:

this.elTest.nativeElement.querySelector("#inputText").focus();

However, it is discouraged to manipulate the dom this way, unless there is 
no other way to achieve what you are looking for. (For now, I do not know 
of another way to set the focus. Getting it is easier.)
It is discouraged because this code will not run on the server or in a 
worker (neither have a way to set the focus!) However, as you code is 
executing in an event handler, it is highly unlikely that it ever will be 
called in those.

Regards
Sander

-- 
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.

Reply via email to