-
-
Save deanlandolt/599389 to your computer and use it in GitHub Desktop.
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
//load the template, should return a promise from the compile() method | |
if (response.status > 400) { | |
//print("Error Response: " + response.status); | |
template = templateEngine.compile("/error/"+response.status); | |
}else{ | |
template = templateEngine.compile(templateId, (mediaParams && mediaParams.template)); | |
} | |
//when we get the template function back, execute it which returns the rendered html | |
// i've tried a bunch of different ways to do this, but i'm not sure what should be happening in the when here | |
return when(template, function(t){ | |
return when(t(object), function(string) { | |
// this assumes the template returns a string | |
return [string]; | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment