📜  指令多输入 - Javascript代码示例

📅  最后修改于: 2022-03-11 15:01:46.210000             🧑  作者: Mango

代码示例1
// Add properties into the Directive class with @Input() decorator

@Directive({
    selector: '[selectable]'
})
export class SelectableDirective{
    private el: HTMLElement;

    @Input('selectable') option:any;   
    @Input('first') f;
    @Input('second') s;

    ...
}


//And in the template pass bound properties to your li element

  • {{opt.option}}