Skip to content

Instantly share code, notes, and snippets.

@Subtletree
Last active March 25, 2018 22:59
Show Gist options
  • Save Subtletree/013564b1691c70062afaa50f979398bb to your computer and use it in GitHub Desktop.
Save Subtletree/013564b1691c70062afaa50f979398bb to your computer and use it in GitHub Desktop.
dynamic render
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle',
templateString: 'Template string {{a}}'
});
body {
margin: 12px 16px;
font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
font-size: 12pt;
}
.box {
border: 1px solid;
}
<h1>Welcome to {{appName}}</h1>
<br>
<br>
{{outlet}}
<br>
<br>
{{textarea value=templateString}}
<br>
<br>
<div class="box">
{{render-template
templateString=templateString
props=(hash a=1 b=1 c=2)}}
</div>
{
"version": "0.13.0",
"EmberENV": {
"FEATURES": {}
},
"options": {
"use_pods": false,
"enable-testing": false
},
"dependencies": {
"jquery": "https://cdnjs.cloudflare.com/ajax/libs/jquery/1.11.3/jquery.js",
"ember": "2.16.2",
"ember-template-compiler": "2.16.2",
"ember-testing": "2.16.2"
},
"addons": {
"ember-data": "2.16.3",
"ember-dynamic-render-template": "0.0.3"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment