📌  相关文章
📜  预期 2 个参数,但得到 1 个. viewchild angular - TypeScript 代码示例

📅  最后修改于: 2022-03-11 14:48:32.989000             🧑  作者: Mango

代码示例1
/*
error TS2554: Expected 2 arguments, but got 1.
In Angular 8, ViewChild takes 2 parameters
In Angular 9 default value is static: false, so doesn't need to provide param unless you want to use {static: true}
*/

@ViewChild(ChildDirective, {static: false}) Component

/*
I hope it will help you.
Namaste
*/