1
我有这样的组件Angular2 - 参考元件状态
@Component({
selector: 'registration-form',
template: `
<label for="email" class="name">Email</label>
<input #email id="email" class="input" ngControl="email">
<tooltip [visible]="if-email-input-above-is-focused"></tooltip>
`,
directives: [
TooltipComponent
]
})
export class RegistrationForm {
}
,我想只显示如果上述输入场聚焦在工具提示组件。事情是,我不想为所有输入字段编写自定义函数,但只是以某种方式引用上面的字段状态。
什么是最聪明的方法来做到这一点?
嘿,它的工作!谢谢 –