0
<parent-component>
<child-component></child-component>
<child-component></child-component>
<child-component></child-component>
<child-component></child-component>
<parent-component>
@Component({
selector: 'child-component',
inputs: [count]
})
我從父組件調用組件,並且我想打印這些子組件調用的次數。如何從父組件檢查子組件被調用的次數
@ViewChildren? –
@MithunSudheendran是的,你可以參考這個文檔https://angular.io/api/core/ViewChildren –