Skip to content

Instantly share code, notes, and snippets.

@CharlesKozel
Last active December 12, 2017 18:02
Show Gist options
  • Save CharlesKozel/7f35021e9063b07a88badaeaf85eed04 to your computer and use it in GitHub Desktop.
Save CharlesKozel/7f35021e9063b07a88badaeaf85eed04 to your computer and use it in GitHub Desktop.
Data Binding Example
import Ember from 'ember';
export default Ember.Component.extend({
});
import Ember from 'ember';
export default Ember.Controller.extend({
users: [
{name:'Chuck', job: 'SDE'},
{name:'Xiaoleig', job: 'SDE'},
{name:'Pete', job: 'SDE'}
],
});
<h2>Users</h2>
{{#each users as |user|}}
{{input value=user.name}}
{{/each}}
<br>
{{#each users as |user|}}
{{input value=user.job}}
{{/each}}
<br>
<h2>User Info</h2>
{{#each users as |user|}}
{{user-info user=user}}
{{/each}}
{{user.name}} is a {{user.job}}
{
"version": "0.12.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.12.0",
"ember-template-compiler": "2.12.0",
"ember-testing": "2.12.0"
},
"addons": {
"ember-data": "2.12.1"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment