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 {
}
,我想只顯示如果上述輸入場聚焦在工具提示組件。事情是,我不想爲所有輸入字段編寫自定義函數,但只是以某種方式引用上面的字段狀態。
什麼是最聰明的方法來做到這一點?
嘿,它的工作!謝謝 –