相关疑难解决方法(0)

无法绑定到'ngIf',因为它不是生产版本中'div'的已知属性

我可以在本地运行.仅在生产构建中获取错误.

我用过

 import { CommonModule } from '@angular/common';
 imports:      [  CommonModule ]
Run Code Online (Sandbox Code Playgroud)

完整错误如下所示.

client:101 Template parse errors:enter code here`Can't bind to 'ngIf' since it isn't a known property of 'div'. 
("move" class="transport-remove">Remove</a></div>
         <div id="carTypeDiv_1" class="veh-inv-out" [ERROR ->]*ngIf="vehicleData.vesselType == 'road'">
            <ul id="carTypeList_1" class="veh-slides">
    "): VehicleDirective@10:52
Property binding ngIf not used by any directive on an embedded template. Make sure that the property name is spelled correctly and all directives are listed in the "@NgModule.declarations". ("t:" (click)="removeField($event)" title="Remove" class="transport-remove">Remove</a></div>
         [ERROR ->]<div id="carTypeDiv_1" …
Run Code Online (Sandbox Code Playgroud)

angular

2
推荐指数
5
解决办法
1万
查看次数

标签 统计

angular ×1