Skip to content

Instantly share code, notes, and snippets.

@bstro
Last active February 9, 2018 22:58
Show Gist options
  • Save bstro/74b2c6f766ae1943dbd3f4fab5a826a6 to your computer and use it in GitHub Desktop.
Save bstro/74b2c6f766ae1943dbd3f4fab5a826a6 to your computer and use it in GitHub Desktop.
New Twiddle
import Ember from 'ember';
export default Ember.Component.extend({
classNames: ["TableGridCell"]
});
import Ember from 'ember';
export default Ember.Component.extend({
tagName: ''
});
import Ember from 'ember';
export default Ember.Component.extend({
classNames: ['grid', 'TableGrid'],
_row: 0,
_column: 0,
actions: {
_incRow: () => this.set('_row', this.get('_row')+1),
_incCol: () => this.set('_column', this.get('_column')+1)
}
});
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle'
});
import Ember from 'ember';
export function compute([action, ...params]) {
return action(...params);
}
export default Ember.Helper.helper(compute);
import Ember from 'ember';
export function range([num]) {
let numbers = [];
for (let i=0; i<num; i++) numbers.push(i);
console.log("numbers are", numbers)
return numbers;
}
export default Ember.Helper.helper(range);
{{#table-grid}}
{{#table-grid-row}}
{{#table-grid-cell}}
Hiii
{{/table-grid-cell}}
{{/table-grid-row}}
{{/table-grid}}
{
"version": "0.13.0",
"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