Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upbuild: enable strictPropertyInitialization #689
Conversation
|
@crisbeto can you please take a look at this Circle CI error? It seems to be related to the Portal Changes in 9.0.0. Should I file a bug here or is there some misconfiguration in this PR? |
|
I just found that this branch/PR were passing on CircleCI, but failing to build locally. It appears that Note that these Template Type Checking errors are new in Angular Additionally, it also runs |
|
OK, the issues that I'm hitting were introduced in Angular I'm investigating how to solve them, but I don't feel like my current solution is solid, so I'm continuing to investigate. |
|
@crisbeto or @JoostK do you have any guidance here? Template<ng-container *ngIf="componentViewer.componentDocItem | async; let docItem">
<span class="cdk-visually-hidden" tabindex="-1" #initialFocusTarget>
Examples for {{docItem.id}}
</span>
<example-viewer *ngFor="let example of docItem.examples"
[example]="example"></example-viewer>
</ng-container>There are errors for
Solutions?It's complaining about The tests in PR angular/angular#33997 don't cover the use case where the Async Pipe is used. How do you recommend developers solve this very common use case? |
|
@Splaktar ah, this is interesting. Using When used with a let assignment to I'll have a look to see if there's something that can be done here. |
|
@JoostK I tried the following and got the same errors: <ng-container *ngIf="componentViewer.componentDocItem | async as docItem"> |
|
@JoostK here is the workaround that I had to apply to get our repo building again after the breaking change in Angular Do you have an open GitHub issue to track this or should I open one? I wasn't able to find one after looking through the Angular issues. |
|
@Splaktar there isn't any issue at the moment, so please open one. In the meantime I am working on a PR to resolve this issue, but I'm not fond of the approach quite yet. The main reason as to why template variables are not properly narrowed is because the "template guard" for the |
|
Opened angular/angular#34572 to track the issue with ngIf + async pipe type narrowing. |
- fix related build errors - complete `this._destroyed` in `ngOnDestroy()` - replace use of deprecated `DomPortalHost` with `DomPortalOutlet`
this._destroyedinngOnDestroy()DomPortalHostwithDomPortalOutletBuilds on PR #688