我有如下自定义组件。我想获取我们在 html 文件中使用的组件的 ID。
@Directive({
selector: `[myattr]`
})
export class myclass
{
// want to get reference where myattr defined
//#myid
}
在 html 中,我将定义如下
<input #myid myattr />
我有如下自定义组件。我想获取我们在 html 文件中使用的组件的 ID。
@Directive({
selector: `[myattr]`
})
export class myclass
{
// want to get reference where myattr defined
//#myid
}
在 html 中,我将定义如下
<input #myid myattr />