Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upAdd support for adding a value provider to a NgModule using schematics #14608
Comments
|
Hi, as far as I recall these methods fall under the private API. That said, we definitely should provide a set of utility methods. //cc @clydin please correctly if I am am wrong. |
|
any news on this feature request ? |
|
Hi, the above mentioned method is part of the private API and is not intended to be used by 3rd parties. If used externally, please be aware that they such methods can be removed/break in non major versions. |
|
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. |
Description
I'm currently working on a library which is an HTTP wrapper of the YouTube Data v3 API: https://github.com/EdricChan03/ngx-ytd-api
Right now, I'm trying to add the ability for a developer to specify an API key to be used for all of the API classes. So far, I've supported that with an injection token, but I would like to simplify that for the developer with the
ng-addschematic which would ask for an API key and declare that API key in the injection token accordingly.However, I can't seem to find any way to import a value provider into the
NgModuledecorator. AFAIK, there's anaddProviderToModulemethod in@schematics/angular/utility/ast-utils, but it only supports class providers:angular-cli/packages/schematics/angular/utility/ast-utils.ts
Lines 506 to 513 in 6ec0991
Describe the solution you'd like
A custom method which would allow for a value provider to be added to a module.
Describe alternatives you've considered
forRoot)