Within my component.ts
file, I currently have the following code setup:
@Component({
selector: 'app-loop-back',
template: `
<input #box (keyup)="0">
<p>{{box.value}}</p>
`
})
export class LoopbackComponent implements OnInit{
sampleString: string;
contructor(){}
ngOnInit(): void {}
}
The functionality in the HTML template allows for immediate display of whatever is typed into <input #box (keyup)="0">
using {{box.value}}
. My query now is how to establish a binding between the input value {{box.value}}
and sampleString: string;
within my component.ts
, enabling me to utilize it elsewhere.