You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As an alternative to publishing a NgModule, library authors might want to export an array of cooperating directives:
export const CAROUSEL_DIRECTIVES = [ImageCarouselComponent, ImageSlideComponent] as const;
Such an array could be imported by applications using NgModules 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).
But following that recommendations triggers Typescript warnings in strict mode because a readonly any[] is not compatible with any[]
Please provide a link to a minimal reproduction of the bug
No response
Please provide the exception or error you saw
No response
Please provide the environment you discovered this bug in (run ng version)
Which @angular/* package(s) are the source of the bug?
core
Is this a regression?
No
Description
The documentation of Standalone components for library authors states:
But following that recommendations triggers Typescript warnings in strict mode because a
readonly any[]
is not compatible withany[]
Please provide a link to a minimal reproduction of the bug
No response
Please provide the exception or error you saw
No response
Please provide the environment you discovered this bug in (run
ng version
)Anything else?
I think
@NgModules.import
should not takeany[]
butReadonly<any[]>
.The text was updated successfully, but these errors were encountered: