I wrote this component:
@Component({
selector: 'formfield',
template: `
<div>
<label>{{label}}</label>
<div>
<input class="form-control" type="text" [(ngModel)]="model">
</div>
</div>
`
})
export class Formfield {
@Input() label: string;
@Input() model: string;
}
I use it here:
<formfield label="something" model="somevalue"></formfield>
Not surprisingly the input field shows the string "somevalue". How can I make it to hold the value of the variable somevalue?