Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit df9b2c1

Browse filesBrowse files
committed
refactor(template): rxChunk: make sure suspense template isn't created with sync strategies
1 parent 8dcc59b commit df9b2c1
Copy full SHA for df9b2c1

File tree

1 file changed

+5
-3
lines changed
Filter options

1 file changed

+5
-3
lines changed

‎libs/template/chunk/src/lib/chunk.directive.ts

Copy file name to clipboardExpand all lines: libs/template/chunk/src/lib/chunk.directive.ts
+5-3Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -143,9 +143,6 @@ export class ChunkDirective implements OnInit, OnDestroy {
143143
) {}
144144

145145
ngOnInit() {
146-
if (this.suspense) {
147-
this.createView(this.suspense);
148-
}
149146
this.subscription = this.strategyProvider
150147
.schedule(
151148
() => {
@@ -159,6 +156,11 @@ export class ChunkDirective implements OnInit, OnDestroy {
159156
}
160157
)
161158
.subscribe(() => this._renderObserver?.next());
159+
// do not create suspense template when strategy was sync and there already
160+
// is a template
161+
if (this.suspense && this.viewContainer.length === 0) {
162+
this.createView(this.suspense);
163+
}
162164
}
163165

164166
ngOnDestroy() {

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.