This file contains hidden or 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({ | |
actions: { | |
onFirst() { | |
let onNewNumber = this.get('onCalculateNewNumber') || Ember.K; | |
onNewNumber(Math.random() * 10); | |
}, | |
onSecond() { |
This file contains hidden or 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({ | |
init() { | |
this._super(...arguments); | |
this.set('value', 0); | |
}, | |
actions: { | |
up() { |
This file contains hidden or 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({ | |
curr_page_idx: 0, | |
actions: { | |
get_page_idx_clicked(idx) { | |
this.set('curr_page_idx', idx); | |
}, | |
} | |
}); |
This file contains hidden or 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({ | |
fieldToBeRetrievedFromParent: 'Hi this property is retrieved from my parent', | |
init: function(){ | |
this._super(...arguments); | |
this.get('parent').registerChild(this); | |
} | |
}); |
This file contains hidden or 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'; | |
import SampleMixin from '../sample-mixin'; | |
export default Ember.Component.extend(SampleMixin, { | |
computedText: Ember.computed.alias('text') | |
}); |
This file contains hidden or 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({ | |
options: [1,2,3,4], | |
actions: { | |
divClicked() { | |
console.log('div clicked'); | |
}, | |
This file contains hidden or 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({ | |
tagName:'input', | |
attributeBindings:['type','style','value'], | |
init() { | |
this._super(...arguments); | |
this.on('paste', this, this._elementValueDidChange); | |
this.on('cut', this, this._elementValueDidChange); |
This file contains hidden or 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', | |
width:100, | |
actions:{ | |
setWidth(value){ | |
console.log(value); | |
} | |
} |
This file contains hidden or 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', | |
category: 'my-category', | |
actions: { | |
makeTransition() { | |
let category = this.get('category'); | |
this.transitionToRoute('my-route'); |
This file contains hidden or 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({ | |
actions: { | |
onFetchPhoto() { | |
this.set('errorOccurred', false); | |
this.get('retrievePhoto')(this.get('photoId')); | |
} | |
} | |
}); |