Skip to content

Instantly share code, notes, and snippets.

@nanuxbe
Created August 9, 2016 06:06
Show Gist options
  • Select an option

  • Save nanuxbe/67f4522e1a4824c3451de4e8fdcc19e4 to your computer and use it in GitHub Desktop.

Select an option

Save nanuxbe/67f4522e1a4824c3451de4e8fdcc19e4 to your computer and use it in GitHub Desktop.
Rob Eisenberg - Ember new syntax component
import Ember from 'ember';
export default Ember.Component.extend({
full_name: Ember.computed(
'first_name',
'last_name',
function() {
return `${this.get('first_name')} ${this.get('last_name')}`
}
)
});
First name: <input value={{first_name}} onKeyUp={{action (mut first_name) value='target.value'}}><br/>
Last name: <input value={{last_name}} onKeyUp={{action (mut last_name) value='target.value'}}><br/>
Hello {{full_name}}
{{hello-world first_name='John' last_name='Doe'}}
{
"version": "0.10.4",
"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.7.0",
"ember-data": "2.7.0",
"ember-template-compiler": "2.7.0"
},
"addons": {}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment