[ ] Regression (a behavior that used to work and stopped working in a new release)
[ ] Bug report
[X] Feature request
[ ] Documentation issue or request
[ ] Support request => Please do not submit support request here, instead see https://github.com/angular/angular/blob/master/CONTRIBUTING.md#question
When Typescript compiler option strictNullChecks
is enabled, the @angular/language-service throws errors.
Example:
interface Foo {
bar: string;
}
@Component({
selector: 'app-foo',
templateUrl: './foo.component.html'
})
export class FooComponent {
foo?: Foo;
}
Example 1:
<app-foo *ngIf="foo" [bar]="foo.bar"></app-foo>
Example 2:
<div *ngIf="foo">{{ foo.bar }}</div>
Error: ng: The expression might be null
I expect *ngIf
to assert the object not to be null, so I can safely use it without any errors.
Angular version: 5.2.2
- Node version: 8.9.1
- Platform: MacOS
- Typescript 2.6.2
I would consider this as a bug, not a feature request.
The language service is unusable with strictNullChecks enabled.
Most helpful comment
I would consider this as a bug, not a feature request.
The language service is unusable with strictNullChecks enabled.