I can access components in a component view using @ViewChildren
decorator like this:
@Component({
selector: 'my-app',
template: `
<alert type="info"></alert>
`,
})
export class App {
@ViewChildren(AlertComponent) alerts: QueryList<AlertComponent>
Is there any way to access DOM elements with @ViewChildren
decorator other then using #
symbol in a template? Maybe some kind of read
parameter flavor?
selector: 'my-app',
template: `
<div #divElement>Tada!</div>
`,
})
@ViewChild("divElement") div: any;
If not possible, please mention that in comments or an answer. Just want to know for sure.