-
Notifications
You must be signed in to change notification settings - Fork 24.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
bug (docs): Bad recommendation to export standalone component groups as readonly
array
#52615
Comments
readonly
array
readonly
arrayreadonly
array
But it does NOT work now and it doesn't seem that the PR will be merged any time soon. |
We should merge this PR, will try to pick it up in the coming days. |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Describe the problem that you experienced
"Standalone components for library authors" section of the docs recommends exporting standalone component groups as
readonly
array, but readonly arrays can not be used inNgModule
imports and language service does not recognizereadonly
arrays when they are imported in standalone component imports.Related issue #48089 which hasn't been resolved for a year now.
Enter the URL of the topic with the problem
https://angular.io/guide/standalone-components#standalone-components-for-library-authors
Describe what you were looking for in the documentation
Good recommendation how to handle standalone component groups in a library.
Describe the actions that led you to experience the problem
Tried to use
readonly
array of standalone components inNgModule
and standalone component imports. When used inNgModule
imports it leads to compilation error and when used in standalone component imports it leads to language service errors.Describe what you want to experience that would fix the problem
Do not recommend to export standalone component groups as
readonly
array. Non-readonly array works but readonly one does not.Add a screenshot if that helps illustrate the problem
No response
If this problem caused an exception or error, please paste it here
No response
If the problem is browser-specific, please specify the device, OS, browser, and version
No response
Provide any additional information here in as much as detail as you can
There was a PR #48106 opened to support readonly array imports in
NgModule
a year ago but it was never merged.@pkozlowski-opensource
The text was updated successfully, but these errors were encountered: