Forked from ianbale/components.test-component.js
Last active
February 8, 2017 14:50
-
-
Save peterjmag/9d5c429919fe5d52ac1b214d08f8d35f to your computer and use it in GitHub Desktop.
testing DOM
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.Component.extend({ | |
someComputedProperty: Ember.computed('item.label', function() { | |
const item = this.get('item'); | |
Ember.Logger.log('someComputedProperty', item.label); | |
return `${item.label} ${new Date}`; | |
}) | |
}); |
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({ | |
data: Ember.A([]), | |
actions: { | |
addData: function() { | |
const data = this.get('data'); | |
data.pushObject({ label: data.length }); | |
}, | |
changeData: function() { | |
this.set('data.0.label', this.get('data.0.label') + 1); | |
}, | |
} | |
}); |
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.4.7", | |
"dependencies": { | |
"jquery": "https://cdnjs.cloudflare.com/ajax/libs/jquery/1.11.3/jquery.js", | |
"ember": "2.10.2", | |
"ember-data": "2.10.0", | |
"ember-template-compiler": "2.10.2" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment