Last active
March 13, 2018 13:57
-
-
Save velrest/5cd81d1d8ee203f62ecc021c08a9fa63 to your computer and use it in GitHub Desktop.
New Twiddle
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Ember from 'ember'; | |
export default Ember.Controller.extend({ | |
appName: 'Ember Twiddle', | |
init() { | |
this._super(...arguments) | |
this.set('headers', [{ | |
type: 'test', | |
title: 'blublibla', | |
attr: 'name', | |
filter: this._filter | |
}, | |
{ | |
type: 'car', | |
title: 'blublibla', | |
attr: 'name', | |
filter: this._filter | |
}] | |
) | |
}, | |
actions: { | |
a() { | |
let header = this.get('headers').filterBy('type', 'test') | |
this.set('model', header.get('filter')(header)) | |
} | |
}, | |
_filter(header) { | |
return header.get('title') | |
} | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"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": "release", | |
"ember-template-compiler": "release", | |
"ember-testing": "release" | |
}, | |
"addons": { | |
"ember-data": "2.16.3" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment