Skip to content

Instantly share code, notes, and snippets.

@stefanpenner
Last active August 29, 2015 14:20
Show Gist options
  • Save stefanpenner/38a36298d04b29bbce5f to your computer and use it in GitHub Desktop.
Save stefanpenner/38a36298d04b29bbce5f to your computer and use it in GitHub Desktop.

example 1 embers code-base

https://github.com/emberjs/ember.js/blob/85550ca7f91883838953e736caa6ef51daabf255/packages/ember-htmlbars/tests/attr_nodes/sanitized_test.js#L23-L25

now:

import compile from "ember-template-compiler/system/compile";
var a = compile("<a href={{url}}></a>"),

future:

something like:

import HBS from "ember-template-compiler/hbs";
var a = hbs`<a href={{url}}></a>`

example 2 tests

this would also let: emberjs/ember-test-helpers#38 work without a client-side template compiler.

this would allow for:

var hbs from 'ember-template-compiler/hbs';

test("foo", function() {
  this.render( hbs`{{my-component name=myColor}}`);
});

components

sometime it is nice to have an extremely concise snippet. This is used all over ember's own code base, so it is similar to 1. But this is another use-case

import Component from 'ember-component';
import hbs from 'ember-template-compilter';

export default Component.extend({
layout: hbs```
  <h1> my cool layout</h1>
  <some-child-component />
  {{yield}}
```
});

notes

  • unsure what the module will be called at this time, but likely similarly to ^^
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment