如何在组件模板中选择元素?
$
$$
.
import {Component} from '@angular/core'@Component({ selector:'display' template:` <input #myname(input)="updateName(myname.value)"/> <p>My name : {{myName}}</p> `})export class DisplayComponent { myName: string = "Aman"; updateName(input: String) { this.myName = input; }}
p
input
慕娘9325324