Last active
August 29, 2015 14:15
-
-
Save jstrimpel/b0437d1c2fbc436dd310 to your computer and use it in GitHub Desktop.
load data for view serialization
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
define(['lazoView'], function (LazoView) { | |
'use strict'; | |
return LazoView.extend({ | |
serializeData: function (options) { | |
var self = this; | |
someAsnycFunc(function (err, localized) { | |
if (err) { | |
options.error(err); | |
} | |
// store data somewhere | |
self.prototype.serializeData.call(self, options); | |
}); | |
}, | |
// ***OR*** | |
transformData: function (data, options) { | |
var self = this; | |
someAsnycFunc(function (err, localized) { | |
if (err) { | |
options.error(err); | |
} | |
options.success(_.extend(data, localized)); | |
}); | |
} | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment