Skip to content

Instantly share code, notes, and snippets.

@mattiaerre
Last active August 20, 2017 22:45
Show Gist options
  • Save mattiaerre/e7de3295d9a16b8b69963997e09276d2 to your computer and use it in GitHub Desktop.
Save mattiaerre/e7de3295d9a16b8b69963997e09276d2 to your computer and use it in GitHub Desktop.
how to client side render an OpenComponents component using the Console (Developer Tools)
((oc, $) => {
// see: https://github.com/opentable/oc/wiki/Browser-client#ocbuild-options
const html = oc.build({
baseUrl: 'http://localhost:3030',
name: 'pi-baltimore-special-offers-promo-banners',
version: '1.X.X',
parameters: {
banner: 'purple-pasta'
}
});
$('body').append(html);
oc.renderUnloadedComponents();
}
)(window.oc, window.jQuery);
// To allow mixed content in Google Chrome:
// https://www.google.com/webhp?sourceid=chrome-instant&ion=1&espv=2&ie=UTF-8#q=mixed%20content%20chrome
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment