Skip to content

Commit b5f9018

Browse files
physicx237alxhub
authored andcommitted
docs: fix programmatic-rendering example (angular#59768)
Fixes example of programmatically rendering of components using dynamic import, as calling dynamic import returns module namespace object rather than component instance PR Close angular#59768
1 parent c03f45c commit b5f9018

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

adev/src/content/guide/components/programmatic-rendering.md

+3-2
Original file line numberDiff line numberDiff line change
@@ -117,10 +117,11 @@ JavaScript [dynamic import](https://developer.mozilla.org/docs/Web/JavaScript/Re
117117
`
118118
})
119119
export class AdminSettings {
120-
advancedSettings: {new(): AdminSettings} | undefined;
120+
advancedSettings: {new(): AdvancedSettings} | undefined;
121121
122122
async loadAdvanced() {
123-
this.advancedSettings = await import('path/to/advanced_settings.js');
123+
const { AdvancedSettings } = await import('path/to/advanced_settings.js');
124+
this.advancedSettings = AdvancedSettings;
124125
}
125126
}
126127
```

0 commit comments

Comments
 (0)