Hello! I have a problem with AoT compilation.
For example I have such form:
<pre>
<form #heroForm="ngForm" (ngSubmit)="addHero()">
<label for="name">Hero name:</label>
<input type="text" id="name" class="form-control"
required
name="name" [(ngModel)]="hero.name"
#name="ngModel" >
<button type="submit"
[disabled]="!heroForm.form.valid" >Add</button>
<div *ngIf="name.errors && (name.dirty || name.touched)"
class="alert alert-danger">
<div [hidden]="!name.errors.required">
Name it!
</div>
</div>
</form>
</pre>
It works fine with JiT compilation, but on AoT I have this error -
<pre>Property 'required' does not exist on type '{ [key: string]: any;
}'</pre>
It concerns other validation types - pattern, min, max and etc.
What have I missed?
--
You received this message because you are subscribed to the Google Groups
"Angular" 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.