Skip to content

Instantly share code, notes, and snippets.

@phkavitha
Created November 24, 2015 13:54
Show Gist options
  • Save phkavitha/6045b1cd23c4ca2897dc to your computer and use it in GitHub Desktop.
Save phkavitha/6045b1cd23c4ca2897dc to your computer and use it in GitHub Desktop.
Template Literals - ES6
import Ember from 'ember';
export default Ember.Controller.extend({
appName:'Ember Twiddle',
param1: "test",
param2: "test2",
actions: {
testFunc() {
var param1 = this.get('param1');
var param2 = this.get('param2');
this.set('testParam', "This is a test param ${param1} and ${param2}");
}
}
});
<h1>Welcome to {{appName}}</h1>
<br>
<br>
{{outlet}}
testParam value: {{testParam}}
<button {{action "testFunc"}}> Click </button>
<br>
<br>
{
"version": "0.4.16",
"EmberENV": {
"FEATURES": {}
},
"dependencies": {
"jquery": "https://cdnjs.cloudflare.com/ajax/libs/jquery/1.11.3/jquery.js",
"ember": "https://cdnjs.cloudflare.com/ajax/libs/ember.js/2.1.0/ember.debug.js",
"ember-data": "https://cdnjs.cloudflare.com/ajax/libs/ember-data.js/2.1.0/ember-data.js",
"ember-template-compiler": "https://cdnjs.cloudflare.com/ajax/libs/ember.js/2.1.0/ember-template-compiler.js"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment