Closed driskull closed 10 years ago
so I could do this:
var myTemplate = new Template(supportsLocalization);
on(myTemplate, "ready", function(config) {
//The config object contains the following properties: helper services, (optionally)
//i18n, appid, webmap and any custom values defined by the application.
//In this example we have one called theme.
Main(config);
});
on(myTemplate, "error", function(error) {
doSomethingwith(error);
});
Or we could change Template to return a deferred. Maybe both options.
var myTemplate = new Template(supportsLocalization).then(function(config){
Main(config);
}, function(error){
doSomethingwith(error)
});
@driskull sounds good. Do you have time to make the edits? Once done I could test with a few templates and make sure everything is ok.
I was thinking it would be something we could tackle after DevSummit. I'll probably take a stab at it then.
Sounds good.
The Template class uses Deferreds that get resolved but when something fails there is no way to report that. My app needs to know when there was an error to stop the loading spinner and display the error. It would be nice if the Deferreds were rejected on error and a 'error' event was emitted. @kellyhutchins What do you think?