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
This commit is contained in:
parent
307db74e93
commit
cce5583e75
|
@ -879,12 +879,14 @@ export type LoadingState<T> = Loaded<T> | Loading;
|
||||||
export class IfLoadedDirective<T> {
|
export class IfLoadedDirective<T> {
|
||||||
@Input('ifLoaded') set state(state: LoadingState<T>) {}
|
@Input('ifLoaded') set state(state: LoadingState<T>) {}
|
||||||
static ngTemplateGuard_state<T>(dir: IfLoadedDirective<T>, expr: LoadingState<T>): expr is Loaded<T> { return true; };
|
static ngTemplateGuard_state<T>(dir: IfLoadedDirective<T>, expr: LoadingState<T>): expr is Loaded<T> { return true; };
|
||||||
|
}
|
||||||
|
|
||||||
export interface Person {
|
export interface Person {
|
||||||
name: string;
|
name: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
template: `<div *ifLoaded="state">{{ state.data }}</div>`,
|
template: `<div *ifLoaded="state">{{ state.data }}</div>`,
|
||||||
})
|
})
|
||||||
export class AppComponent {
|
export class AppComponent {
|
||||||
state: LoadingState<Person>;
|
state: LoadingState<Person>;
|
||||||
|
|
Loading…
Reference in New Issue