CopyPastor

Detecting plagiarism made easy.

Score: 0.802838146686554; Reported for: String similarity Open both answers

Possible Plagiarism

Plagiarized on 2019-07-02
by ORBIT

Original Post

Original - Posted on 2017-04-13
by Sabari



            
Present in both answers; Present only in the new answer; Present only in the old answer;

you are tring to get the value from html before rendering completely. If you try to print the value in a button click, it will works.
depend on your code I have modified a little.Try the below, it is working for me.
ngAfterViewInit() { console.log("afterinit"); setTimeout(() => { this.messageElement.nativeElement.focus()); console.log(this.abc.nativeElement.innerText); }, 1000); }
I think you are tring to get the value from html before rendering completely. If you try to print the value in a button click, it will works.
depend on your code I have modified a little.Try the below, it is working for me.
ngAfterViewInit() { console.log("afterinit"); setTimeout(() => { console.log(this.abc.nativeElement.innerText); }, 1000); }
**Note:** If not working, please increase the timeout time and try again.

        
Present in both answers; Present only in the new answer; Present only in the old answer;