pjlamb12 / runtime-config-loader Goto Github PK
View Code? Open in Web Editor NEWThis is an Angular library that provides an easy way to load a configuration JSON file for runtime configuration.
This is an Angular library that provides an easy way to load a configuration JSON file for runtime configuration.
I'm facing the same issue as mentioned in the documentation:
In some cases, the config.json is not finished loading before other modules/services are, so the above methods will return null. If that is the case, subscribe to the configSubject and access the configuration object that way.
I'm using runtime-config-loader to load the config file for angular-auth-oidc-client's AuthModule!
but I couldn't use configSubject and couldn't find any sample code for using it! Maybe a sample code solves my problem!
I mean I tried subscribing to configSubject but it's still null!
Add tests to the service
This is something that is related to the discussion in #48.
I've figured out a way to provide the config as an Injection token, so you can reference it like this:
constructor(@Inject(APP_CONFIG) private appConfigObject: any) {}
Allow for multiple file paths being passed in for configuration to be loaded. This would be ideal for situations where a configuration file is saved in source control, but a local, untracked configuration file could also be used. The files would be loaded in the order in which they're passed, and merged together.
deepmerge looks like the perfect package to help with this.
The APP_INITIALIZER Token can be moved into this module's providers array, meaning all a user would have to do is import the module:
RuntimeConfigLoaderModule.forRoot({ configUrl: '' })
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.