Skip to content

Instantly share code, notes, and snippets.

@hatched
Created April 20, 2013 18:05
Show Gist options
  • Save hatched/5426842 to your computer and use it in GitHub Desktop.
Save hatched/5426842 to your computer and use it in GitHub Desktop.
initializer: function(cfg) {
// service model promise
cfg.service.then(
Y.bind(this.serviceDataReceived, this),
Y.bind(this.noServiceAvailable, this));
this.after('modelChange', function() {
this.render();
}, this);
},
serviceDataReceived: function(model) {
// set the model with the data returned from the promise
this.set('model', model);
},
noServiceAvailable: function(data) {
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment