Hi,

I need to get 5 components innerText in app component .

I tried @viewchild but unable to achive. any clue?

export class AppComponent implements AfterViewInit {

@ViewChild("myDiv") divView: ElementRef;
@ViewChild("myDiv") linkone: LinkOneComponent;

ngAfterViewInit(){

console.log(this.divView);
this.divView.nativeElement.innerText = "Hello Angular 9!"; // I can get 
same Appcomponent innerText here
this.linkone.nativeElement.innerText // here am trying to read innerText 
from LinkOneComponent but nativeElement not available
}

-- 
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 angular+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/angular/cfd8e34a-4ea4-4444-8a6a-00ba42992858o%40googlegroups.com.

Reply via email to