Below, i have made a Plunker for my example : http://plnkr.co/8fVExZ
I can't reproduce my problem on Plunker.
My problem is that I initialize my form with my company entity :
createFormBuilder(company: Company) {
this.companyForm = this.formBuilder.group({
'country': [company.country, Validators.required],
'email': [company.email, [Validators.required,
ValidationService.emailValidator]],
'url': [company.url, Validators.required,
this.companyValidator.slugValidator.bind(this.companyValidator)],
'phoneNumber': [company.phoneNumber, Validators.required]
});
}
<div *ngIf="companyForm">
<form (ngSubmit)="submit()" [formGroup]="companyForm">
<div class="form-group">
<label for="company-url" class="col-md-2 control-label">Url : </label>
<div class="col-md-10">
<input type="text"
[formControl]="companyForm.controls.url"
id="company-url"
class="form-control"
required
/>
</div>
</div>
<div class="form-group">
<label for="company-email" class="col-md-2 control-label">Email :
</label>
<div class="col-md-10">
<input type="text"
[formControl]="companyForm.controls.email"
id="company-email"
class="form-control"
required
/>
</div>
</div>
<div class="form-group">
<label for="company-phone-number" class="col-md-2 control-label">Phone
Number : </label>
<div class="col-md-10">
<input type="text"
[formControl]="companyForm.controls.phoneNumber"
id="company-phone-number"
class="form-control"
required
/>
</div>
</div>
<div class="form-group">
<label for="company-country" class="col-md-2 control-label">Country :
</label>
<div class="col-md-10">
<input type="text"
[formControl]="companyForm.controls.country"
id="company-country"
class="form-control"
required
/>
</div>
</div>
<button type="submit">Submit</button>
</form>
</div>
In my console, i have this error : "Expression has changed after it was
checked. Previous value: 'false'. Current value: 'true'".
If i replace one of initialize value by an empty string or if i delete the
url input, the error disappear.
--
You received this message because you are subscribed to the Google Groups
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.