Skip to content

Instantly share code, notes, and snippets.

@phillipkregg
Created May 15, 2018 14:52
Show Gist options
  • Save phillipkregg/d3ecc8bd647fce56187796160b6967be to your computer and use it in GitHub Desktop.
Save phillipkregg/d3ecc8bd647fce56187796160b6967be to your computer and use it in GitHub Desktop.
Render HTML from Route
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle',
fromControllerToTemplate: Ember.computed('model', function() {
return this.get('model');
})
});
import Ember from 'ember';
export default Ember.Helper.helper( params => {
return new Ember.Handlebars.SafeString(params.join(''));
});
import Ember from 'ember';
import config from './config/environment';
const Router = Ember.Router.extend({
location: 'none',
rootURL: config.rootURL
});
Router.map(function() {
});
export default Router;
import Ember from 'ember';
export default Ember.Route.extend({
model() {
return {
html: '<h3>Some HTML Dawg!</h3>'
}
}
});
body {
margin: 12px 16px;
font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
font-size: 12pt;
}
{{html-safe fromControllerToTemplate.html}}
{
"version": "0.13.1",
"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"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment