I am trying to re-write an application using angular.js, but I still do not see how it works (more or less).
For instance. In my previous code, I had a function that was executed once everything was loaded that initialised variables, accessed for everyone in a window.variable style.
Now I want the same here.
My idea was to build a factory to return an object with all the variables, and then make that everyone had access to this object (somehow).
The questions are: 1- Am I right? I should initialise variables through a factory? 2- And how can I "call" this factory-method at the beginning of the code? with the module.run function?
Cheers,