📅  最后修改于: 2022-03-11 15:02:21.710000             🧑  作者: Mango
-------------------------
import { ViewChildren, QueryList } from '@angular/core';
/** Get handle on cmp tags in the template */
@ViewChildren('cmp') components:QueryList; // or ElementRef if only need to grab element
ngAfterViewInit(){
// print array of CustomComponent objects
console.log(this.components.toArray());
}