Hi guys,
I need to understand the best practices for configure my app. Could you please give me an advice? In java project, for example, we have a properties file. What is the common approach for ionic app? Can I use the ionic.config.json file and access to properties programmatically?
You can put your own static version of settings in src/assets as a json file which u retrieve using http. Naming convention of file and folder is up to you
Static Settings that need to be overriden as part of the apps options can be locally stored in localstorage (see ionic storage) or online to an online database like Firebase or any other solution u prefer
For configuration, I use a static json object. Super easy to use, available everywhere in my pages and components, available at runtime, no config to make it available and no worries about boot time. There are probably better solution, but I found that handy.
See my example there
P.S.: In java this would be equals to something like a class with static variables
public class Resources {
public static final String API_URL = "https://";
}
Arent *.d.ts files meant to be for typescript defintions only and hence fairly empty in terms of logic? Like interfaces or class definitions with no code?