标签: angular forms
我有一个模板驱动的表单,其内容来自ng-content,我可以使用@ContentChildren(NgModel, { descendants: true }) public models: QueryList<NgModel>;获取直接子级数据,但无法获取任何子组件数据。
@ContentChildren(NgModel, { descendants: true }) public models: QueryList<NgModel>;
我在这里https://stackblitz.com/edit/angular-vcqaxp举例说明,因为用单词解释它可能有点复杂。
谢谢