I have the following in my component.ts file:
@Component({
selector: 'app-loop-back',
template: `
<input #box (keyup)="0">
<p>{{box.value}}</p>
`
})
export class LoopbackComponent implements OnInit{
sampleString: string;
contructor(){}
ngOnInit(): void {}
}
Basically whatever I typed in the <input #box (keyup)="0"> will be shown immediately in the {{box.value}}. As this is purely in the html file, I am wondering how can I bind the input {{box.value}} to sampleString: string; in my component.ts so that I can use it somewhere else.