相关疑难解决方法(0)

为Angular根组件/模块指定@Input()参数

我有3个根组件,由root引导AppModule.

你如何@Input()为其中一个组件指定参数?

也不

<app-modal [id]="'hard-coded value'"></app-modal>
<app-modal [id]="constantExportedByAppmodule"></app-modal>
Run Code Online (Sandbox Code Playgroud)

通过AppModalComponent以下方式获取:

@Input() id: string;
Run Code Online (Sandbox Code Playgroud)

这是未定义的.

angular-bootstrap angular

14
推荐指数
2
解决办法
6389
查看次数

标签 统计

angular ×1

angular-bootstrap ×1