I have in my project a form with an input like this:
@Input()
article: Article;
ngOnInit() {
this.articleForm = this.formBuilder.group({
title: [ '', Validators.required]
});
form.component.html:
<input class="form-control" formControlName="title"
type="text" value="{{article ? article.title : ''}}" />
Article is an Object with title attribute and article is an input property.
The Problem is when the input property get an article with a valid title the input value change to the value of the title but strangely steal in invalid state !
Can any one give me an idea of what happening please ?
Thanks in advance.