-
Notifications
You must be signed in to change notification settings - Fork 56
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
I try to use the angular-l10n library in an angular library. How can I implement it in an library and use that library with translation in my project #307
Comments
Hi,
If other scenarios work (like having assets and initializing angular-l10n services also in the angular library), they would only work out of the box. |
Thank you for your answer. Do you have some idea, what the reason is for this error? I have no Idea where I have to declare the provider for L10N_LOCALE and how. |
Please provide the steps to reproduce the problem. And then: are you getting the error by running the app, or the library by itself (for example for testing)? |
I created an repository to show the problem: git@github.com:hschindler/LibraryDemo.git I found out that including angula-l10n works if I add the library to the main project with "ng add library". The directory Client App is the main app. In it under projects is the library. You can change the configuration in "tsconfig.json" of the client app to test both variants. The injection error occurs when using: I hope you can handle this. |
@hschindler The usual scenario is your ClientApp: the libraries and the app in the same workspace. And it works. About the second scenario (the library in a separate workspace): I don't know if it can depend on this library, or on Angular itself. There have already been such problems with Angular in the past when referencing an external project: see also #146 Need to investigate. |
As a workaround you could change the
and then reference it in
Note: if the external library is packed, and installed in the |
Closed due to inactivity |
Is there an existing docs on how we can implement this? Particularly when used in standalone components in the library. I'm fairly new to Angular and I can't imagine how to implement this well quite just yet |
Hi,
have you sample code, how to implement this library in an angualr library?
My angular project and my custom angular library should both use the angular-l10n.
The translation in the main project works. But how can I implement it in the library project?
Is it possible that the library has it own translation fles in an assets folder?
I use angular version 9.
It would be great if you coukd help me.
The text was updated successfully, but these errors were encountered: