gpt4 book ai didi

根指令上的 Angular 2 输入参数

转载 作者:太空狗 更新时间:2023-10-29 17:00:25 24 4
gpt4 key购买 nike

<分区>

This示例显示了如何在子组件上使用 @Input() 注释。我的问题是你如何在根组件上使用它?例如,如果您修改上面链接上的代码:

@Component({
selector: 'app',
template: `
<bank-account bank-name="RBC" account-id="4747"></bank-account>
`,
directives: [BankAccount]
})
class App {
@Input() something: string;
}

bootstrap(App);

在 html 中:

<app something="Test"></app>

上面的例子从不更新 App 组件的something属性。

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com