Yes. That works. I have an app that is quite customizable, so the user has a lot of preferences to choose from. Before the rest of the app loads, I do this:
- // Load all of User #1's prefs
- Preference.findOne({'id':1}, function(prefs){
- window.preferences = prefs;
- });
In another controller, I listen for any time the prefs change and save them.
- // Saves all preferences whenever any of them change!!! Yay!
- '{preferences} change': function(type, event, what, how){
- this.savePrefs();
- },