Looking for a simple solution - I have a component with a string that I want to display in an input field.
I attempted the following approach, but it didn't work as expected:
import {Component} from "@angular/core";
@Component({
selector: 'my-component',
template: `
<input type="text" ([ngModel])="myVar" >
`
})
export class MyComponent{
constructor(){
}
myVar: string = "Hello World"
}