我一直在寻找其他人是否遇到过此错误一段时间,但无济于事。我最近将我的网站升级到 Angular 8 并开始使用 Angular CLI 而不是 webpack。我终于用 --aot 标志运行了一个生产版本,发现一些奇怪的行为,Angular Material Labels 不像往常那样浮动。我的浏览器中也没有任何控制台错误。
<mat-form-field appearance="outline" floatLabel="always">
<mat-label>{{ label || 'User' }}</mat-label>
<input matInput spellcheck="false" [formControl]="userInputControl">
<mat-icon matPrefix style="cursor: pointer; margin-right: 10px;">search</mat-icon>
<mat-icon matSuffix style="cursor: pointer;" (click)="updateUserListSettings()">person</mat-icon>
<mat-hint>Search using User ID, Name, or Email Address</mat-hint>
</mat-form-field>
<mat-form-field class="te-form-225" appearance="outline">
<mat-label>Role Class</mat-label>
<mat-select [(ngModel)]="filterRoleClass" (selectionChange)="filterRoles()">
<mat-option *ngFor="let rc of roleClasses" [value]="rc">{{ rc | titleCase }}</mat-option>
</mat-select>
</mat-form-field>
Angular CLI: 8.3.20
Node: 12.13.1
OS: win32 x64
Angular: 8.2.14
... animations, common, compiler, compiler-cli, core, forms
... language-service, platform-browser, platform-browser-dynamic
... router
Package Version
-----------------------------------------------------------
@angular-devkit/architect 0.803.10
@angular-devkit/build-angular 0.803.10
@angular-devkit/build-optimizer 0.803.10
@angular-devkit/build-webpack 0.803.10
@angular-devkit/core 8.3.10
@angular-devkit/schematics 8.3.20
@angular/cdk 8.2.3
@angular/cli 8.3.20
@angular/material 8.2.3
@ngtools/webpack 8.3.10
@schematics/angular 8.3.20
@schematics/update 0.803.20
rxjs 6.5.3
typescript 3.5.3
webpack 4.41.1