使用ng build --prod进行构建时,Type Object不是通用的

时间:2017-08-15 01:32:49

标签: angular typescript

我的组件类中有以下声明     formErrors:对象;

使用ng build --prod时,它会抛出  输入'对象'不是通用的。

但是在运行时编译中使用ng服务

我在模板

中使用了如下的formErrors



   <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>
&#13;
&#13;
&#13;

0 个答案:

没有答案