This file contains invisible Unicode characters that may be processed differently from what appears below. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to reveal hidden characters.
'use strict';
define(
[
'templates'
], function (Templates) {
return function () {
this.get = function (templateId) {
var templateKey = templateId.toLowerCase();
var templateFunction = Templates[templateKey];
if (!templateFunction) {
throw 'couldn\'t find pre-compiled template ' + templateKey;
}
return function (data) {
try {
return templateFunction(data);
catch (error) {
console.error('template render failed for ' + templateKey + ' ' + error);
console.error(data);
throw error;
};
});