ember-dynamic-render
v1.0.0
Published
The default blueprint for ember-cli addons.
Downloads
6
Readme
ember-dynamic-render
Allows to render a template from a string.
For example {{dynamic-render '<h1>{{model.foo}}</h1>' model}}
Requres HTMLBars compiler
HTMLBars compiler must be explicitely loaded before this component is rendered. The compiler can be included in vendor.js or loaded via a script.
Loading script in route
- Install
ember-inject-script
addon. - Inject
ember-template-compiler.js
in afterModel of the route where the component will be rendered.
import Ember from 'ember';
import injectScript from 'ember-inject-script';
export default Ember.Route.extend({
model() {
return { foo: 'bar' };
},
afterModel() {
return injectScript('//builds.emberjs.com/release/ember-template-compiler.js');
}
});
vendor.js
Note: this will increase the download size of your application. Consider loading script in the route.
In ember-cli-build.js
add app.import('bower_components/ember/ember-template-compiler.js')
.