Reputation: 965
In my application I want to get initial call with some settings for application. These will include forms data (validation rules, dropdowns' options...), maybe some other settings (tbd).
What is best practice of storing this data?
Just object in server? Local storage?....
In AngularJS I remember using rootScope (which was not ideal).
Thanks for advice.
Upvotes: -1
Views: 621
Reputation: 222582
There are two recommended practices,
When you create your angular application with Angular CLI you always have a folder with environment files:
<APP_FOLDER>/src/environments/
└──environment.ts
└──environment.prod.ts
you can create additional target-specific configuration files, such as environment.qa.ts and environment.staging.ts.
and use them in your service (the correct environment file is chosen automatically).
Other way is to add your json files to assets folder and use http get to serve those files.
Upvotes: 2