Quantcast
Channel: JavaScriptMVC Forum
Viewing all articles
Browse latest Browse all 3491

Re : Templated events and observes

$
0
0
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:

  1. // Load all of User #1's prefs
  2. Preference.findOne({'id':1}, function(prefs){
  3.     window.preferences = prefs;
  4. });


In another controller, I listen for any time the prefs change and save them.
  1. // Saves all preferences whenever any of them change!!!  Yay!
  2. '{preferences} change': function(type, event, what, how){
  3.    this.savePrefs();
  4. },

Viewing all articles
Browse latest Browse all 3491

Trending Articles