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 –