Angularjs ng.IComponentOptions绑定列表
我正在使用ng.IComponentOptions创建包含控制器和视图模板的组件类,如下所示:Angularjs ng.IComponentOptions绑定列表,angularjs,typescript,Angularjs,Typescript,我正在使用ng.IComponentOptions创建包含控制器和视图模板的组件类,如下所示: export class LCAConfiguratiePersonenDetailComponent implements ng.IComponentOptions { public templateUrl: string; public controller: any; public bindings: any; public static IID: string
export class LCAConfiguratiePersonenDetailComponent implements ng.IComponentOptions {
public templateUrl: string;
public controller: any;
public bindings: any;
public static IID: string = 'lcaConfiguratiePersonenDetail';
constructor() {
this.templateUrl = require('./LCAConfiguratiePersonenDetail.template.html');
this.controller = LCAConfiguratiePersonenDetailComponentController;
this.bindings = {
id: '<'
};
}
}
export类LCAConfigulatiePersonenDetailComponent实现ng.IComponentOptions{
公共模板URL:string;
公共控制人:任何;
公共约束:任何;
公共静态IID:string='lcaconfigurationPersonenDetail';
构造函数(){
this.templateUrl=require('./lcaconfigurationPersonenDetail.template.html');
this.controller=LCAConfigurationPersonDetailComponentController;
此文件的绑定={
id:“因为typescript传输到AngularJS代码,所以在查看
输入应使用<和@bindings。符号<表示从1.5开始可用的单向绑定。与=的区别在于,组件范围中的绑定属性不受监视,这意味着如果您为组件范围中的属性分配新值,它将不会更新父范围。但是,请注意,父范围和nd组件作用域引用同一个对象,因此如果您正在更改组件中的对象属性或数组元素,则父级仍将反映该更改。因此,一般规则应该是永远不要更改组件作用域中的对象或数组属性。@当输入为字符串时,尤其是当值为f绑定不变
bindings: {
hero: '<',
comment: '@'
}
bindings: {
onDelete: '&',
onUpdate: '&'
}