0

I have following declaration in my component class formErrors:Object;

while using ng build --prod, it throws Type 'Object' is not generic.

but every things working in run time compilation, using ng serve

and i have used the formErrors as below in my template

   <div class="col-md-12 col-sm-12 col-xs-12 form-group has-feedback required" [ngClass]="{'has-error':formErrors?.country}">
          <input class="form-control has-feedback-left" name="country" [(ngModel)]="customer.country" placeholder="Country" type="text">
          <span class="fa fa-map-marker form-control-feedback left" aria-hidden="true"></span>
          <span class="help-block" *ngIf="formErrors?.country">{{formErrors?.country[0]}}</span>
        </div>
user3209130
  • 362
  • 5
  • 13
  • Give us one example of you using `formErrors` in the template – Harry Ninh Aug 15 '17 at 01:36
  • 1
    Maybe use `any` instead of `Object`? Check out this post: https://stackoverflow.com/questions/18961203/typescript-any-vs-object – DeborahK Aug 15 '17 at 02:19
  • sorry, it was my mistake i put small portion of form input above and the actually the error was produced from another field where i left to place '?' – user3209130 Aug 20 '17 at 13:20

0 Answers0