My challenge is that I am trying to create "global" helper functions and I am not sure the best way to do it within Designer. Any recommendations?
So I created an application function and gave it 3 parameters. Question: How do I call that function from within the application?
Now when I put code into the function and save it, the generated files do not contain the content. Further more if you quit the app, you will see a prompt telling you that you have unsaved changes. If I make changes somewhere else in the app and save, it will allow me to exit the app without getting the warning, but then the content of the application functions are lost.
If I want to create a singleton class that does not extend any of your components so that I can use that, should I do this in the application's launch method or is there a better way to do that?
I see that behavior too. The project can be saved when function added to the application object of a project contains no code. If the function contains any code the project always appears to be unsaved. Also, the function cannot be deleted. After deletion the function disappears from the project hierarchy panel but it is still emitted and appears when the application node is selected.
Your question is a good one. What is the recommended way to add global function or other code on which an application might rely? At the moment my approach is to use an index.html instead of relying on designer.html because additional script references can be added to it. However it does mean I cannot use the preview function.