С некоторого времени проверка типов не работает в шаблонах Angular в VSCode.
У меня есть следующий код:
<div *ngIf="activeProperty" class="mx-3">
<!-- some other code -->
<input
required
id="propertyName"
type="text"
class="form-control"
name="propertyName"
[ngModel]="activeProperty.uiProperty.label"
(ngModelChange)="updateLabelAndKeyInSpec($event)"
/>
</div>
Теперь в этой строке:
[ngModel]="activeProperty.uiProperty.label"
activeProperty
подчеркнут, говоря мне, что The expression might be null
, что явно неправильно, потому что я проверяю это на *ngIf
выше.
Пожалуйста, смотрите мой ng --version
здесь:
/ \ _ __ __ _ _ _| | __ _ _ __ / ___| | |_ _|
/ △ \ | '_ \ / _` | | | | |/ _` | '__| | | | | | |
/ ___ \| | | | (_| | |_| | | (_| | | | |___| |___ | |
/_/ \_\_| |_|\__, |\__,_|_|\__,_|_| \____|_____|___|
|___/
Angular CLI: 8.3.6
Node: 12.7.0
OS: win32 x64
Angular: 8.2.8
... animations, common, compiler, compiler-cli, core, forms
... language-service, platform-browser, platform-browser-dynamic
... router
Package Version
-----------------------------------------------------------
@angular-devkit/architect 0.803.6
@angular-devkit/build-angular 0.803.6
@angular-devkit/build-optimizer 0.803.6
@angular-devkit/build-webpack 0.803.6
@angular-devkit/core 8.3.6
@angular-devkit/schematics 8.3.6
@angular/cdk 8.2.2
@angular/cli 8.3.6
@angular/http 7.2.15
@ngtools/webpack 8.3.6
@schematics/angular 8.3.6
@schematics/update 0.803.6
rxjs 6.5.3
typescript 3.5.3
webpack 4.39.2
Я что-то не так делаю?