Hi,
This is a general, best practices question.
What is the best approach to sharing configurations between widgets? Let's say I have some configurations that several widgets need to access. Instead of repeating the configurations in each widgets own config.json file, it seems better to place them in a shared or common config.json file.
Likewise for utility type functions that could be used by multiple widgets. Is there an approach others have used for this?
Thanks
Solved! Go to Solution.
Zorba,
The one option for that would be to add that function to one of the js files that always gets added when using the app like MapManager.js or configloader.js that way you can call MapManager.getInstance().yourFunctionName()
I would add it to the apps main config file each widget has access to the this.appConfig variable.
Thanks Robert. Sounds good.
What about the second part of my question? What if you have several widgets that can use the same function. Is there a standard way to handle that. I'd like to avoid redundantly adding that same function to each widget.
Zorba,
The one option for that would be to add that function to one of the js files that always gets added when using the app like MapManager.js or configloader.js that way you can call MapManager.getInstance().yourFunctionName()
Great. Thanks for the suggestion.