Questions tagged nested-object

Explore the latest questions and answers asked by our top developers.

How to Read values from nested json objects in the config.json file with the help of config service class

This is my config.json File { "timeout":10000 "Status":{ "Error":{"message":"Runtime","continue":False} } } And below is the config service class export class ConfigService { private config: Object = null; constructor(private http: HttpClient) {} public getConfig(key:any){ return this.config[key]; } public loadConfig() { return this.http .get<Config>(‘../configuration/config.json’) .toPromise() .then(Configdata => { this.config = Configdata; console.log("error duration:",Configdata); }); } } First […]

By rissa
Published
Categorized as angular, config.json, nested-object Tagged , ,

How to read the values of nested objects from the Config file

This is my config.json File { "Status":{ "Error":{"message":"Runtime","continue":False} } } First I want to read the value "Error" and the the value "False" and assign them to two different variables. How can I read those two values Any help is appreciated. Thankyou. Source: Angular Questions

By rissa
Published
Categorized as angular, config.json, nested-object Tagged , ,

Still Have Questions?


Our dedicated development team is here for you!

We can help you find answers to your question for as low as 5$.

Contact Us
faq