From cce5583e754dff10cb051015a25145cc56d2a54e Mon Sep 17 00:00:00 2001 From: Andrew Scott Date: Thu, 23 Jul 2020 16:30:31 -0700 Subject: [PATCH] docs(core): Fix incorrectly rendered code example in structural directives guide (#38207) The code example was missing a close brace and also incorrectly rendered the template div as an actual div in the page DOM. PR Close #38207 --- aio/content/guide/structural-directives.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/aio/content/guide/structural-directives.md b/aio/content/guide/structural-directives.md index 8b2bd6bc2d..b49c5199d8 100644 --- a/aio/content/guide/structural-directives.md +++ b/aio/content/guide/structural-directives.md @@ -879,12 +879,14 @@ export type LoadingState = Loaded | Loading; export class IfLoadedDirective { @Input('ifLoaded') set state(state: LoadingState) {} static ngTemplateGuard_state(dir: IfLoadedDirective, expr: LoadingState): expr is Loaded { return true; }; +} + export interface Person { name: string; } @Component({ - template: `
{{ state.data }}
`, + template: `<div *ifLoaded="state">{{ state.data }}</div>`, }) export class AppComponent { state: LoadingState;