Angular2的当前文档没有提供使用@Input
和@Output
在es5语法中的示例.
我试图让一个有角度的小提琴,所以需要使用es5
这是es2016版本
class BankAccount {
@Input() bankName: string;
@Input('account-id') id: string;
// this property is not bound, and won't be automatically updated by Angular
normalizedBankName: string;
}
Run Code Online (Sandbox Code Playgroud)
ale*_*ods 13
注释中的使用inputs
和outputs
属性Component
.看到这个plunker.
var BankAccount = ng
.Component({
selector: 'bank-account',
template: '<b>{{ bankName }}<b><span>{{ id }}',
inputs: [
'bankName',
'id: accountId'
]
})
.Class({
constructor: function() {
this.bankName = null;
this.id = null;
}
});
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
1190 次 |
最近记录: |