Skip to content

Instantly share code, notes, and snippets.

@nojacko nojacko/
Last active Nov 10, 2016

What would you like to do?
Dynamically render HTMLBars.

How to use

{{dynamic-template source=htmlbarsTemplateStingHere}}
import Ember from 'ember';
export default Ember.Component.extend({});
{{#if subLayout}}
{{dynamic-template-render layout=subLayout}}
import Ember from 'ember';
export default Ember.Component.extend({
source: '',
subLayout: null,
didInsertElement() {'afterRender', this, 'updateTemplate');
updateTemplate() {
this.set('subLayout', null);'afterRender', this, function() {
this.set('subLayout', Ember.HTMLBars.compile(this.get('source')));
observerSource:'source', function() { this.updateTemplate(); }),
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.