Skip to content

Commit f9e21d3

Browse files
Ashley Hunteralxhub
authored andcommitted
docs: fixing standalone components sample code (#47542)
PR Close #47542
1 parent 8637253 commit f9e21d3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

aio/content/guide/standalone-components.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ This pattern is useful for Angular libraries that publish a set of cooperating d
220220
As an alternative to publishing a `NgModule`, library authors might want to export an array of cooperating directives:
221221

222222
```ts
223-
export CAROUSEL_DIRECTIVES = [ImageCarouselComponent, ImageSlideComponent] as const;
223+
export const CAROUSEL_DIRECTIVES = [ImageCarouselComponent, ImageSlideComponent] as const;
224224
```
225225

226226
Such an array could be imported by applications using `NgModule`s and added to the `@NgModule.imports`. Please note the presence of the TypeScript’s `as const` construct: it gives Angular compiler additional information required for proper compilation and is a recommended practice (as it makes the exported array immutable from the TypeScript point of view).

0 commit comments

Comments
 (0)