Thanks Sander for your lines!
I'm happy you spend your time for this problem.
You are rigt, the id is different.
Nevertheless I found out, that I can get the element, when I ask for in the
ngOnInit-Method.
Cheeers, Frank
Am Montag, 19. März 2018 13:09:07 UTC+1 schrieb Frank Mehlhop:
>
> Hi,
>
> I got a angular application created by cli.
> At a componant.ts I got this code inside the constructor:
> function getLangSelector() {
> return document.getElementById('getLangSelector()
> !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!');
> }
>
> const e = document.getElementById('langSelector');
> if (e === undefined) {
> console.log('Can\'t find langSelector !!!!!!!!!!!!!!!!');
> } else {
> if (getLangSelector() === null) {
> console.log('getLangSelector() === null !!!!!!!!!!!!!!!!');
> } else {
> console.log('getLangSelector() !== null !!!!!!!!!!!!!!!!');
> }
> }
>
> the only log I get at the console is:
>
> "getLangSelector() === null !!!!!!!!!!!!!!!!"
>
>
> Why I don't get the log "getLangSelector()
> !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
> from the function getLangSelector()?
> *What I need to change to get it work?*
>
> Frank
>
--
You received this message because you are subscribed to the Google Groups
"Angular and AngularJS discussion" 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.