Skip to content

Commit

Permalink
Merge pull request #429 from opentable/GPT-518
Browse files Browse the repository at this point in the history
[GPT-518] dynamically register templates on browser client
  • Loading branch information
matteofigus authored Apr 5, 2017
2 parents 258b0d1 + 60f1571 commit ab200cf
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
7 changes: 4 additions & 3 deletions src/components/oc-client/server.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
'use strict';

module.exports.data = function(context, callback){
callback(null, { staticPath: context.staticPath });
};
export const data = (context, callback) => {
const { staticPath, templates } = context;
return callback(null, { staticPath, templates });
};
7 changes: 6 additions & 1 deletion src/components/oc-client/template.jade
Original file line number Diff line number Diff line change
@@ -1 +1,6 @@
script(src=staticPath+"src/oc-client.min.js", type="text/javascript")
script.
window.oc = window.oc || {};
oc.conf = oc.conf || {};
oc.conf.templates = oc.conf.templates || [];
oc.conf.templates = oc.conf.templates.concat(!{JSON.stringify(templates)});
script(src=staticPath+"src/oc-client.min.js", type="text/javascript")

0 comments on commit ab200cf

Please sign in to comment.