标签:href read OLE after about hub view example temp
It is not clear in the Docs about {read: xx} option for @ViewChild.
Based on the Source code, @ViewChild as view as Component, ElementRef, TemplateRef.
For example, we have:
<one></one>
@ViewChild(OneComponent)
one: OneComponent;
ngAfterViewInit() { console.log(‘after‘, this.one); }
Now we read ‘OneComponent‘ as a component, if we want to read it as ElementRef, we can do:
@ViewChild(OneComponent, {read: ElementRef})
one: ElementRef;
[Angular] ViewChild 'read' option
标签:href read OLE after about hub view example temp
原文地址:https://www.cnblogs.com/Answer1215/p/10192285.html