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 { computed } from '@ember/object'; | |
import { inject as service } from '@ember/service'; | |
export default Ember.Controller.extend({ | |
router: service(), | |
currentURL: computed('router.currentURL', function() { | |
return this.router.currentURL; | |
}), |
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({ | |
dynamicValue: 'other-component', | |
}); |
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 Component from 'sparkles-component'; | |
export default class extends Component { | |
items = [0,9,8,7,6,5]; | |
} |
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 Component from '@ember/component'; | |
export default class ItemComponent extends Component { | |
didInsertElement() { | |
console.log(`item ${this.item} was inserted`); | |
} | |
} |
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 Component from '@ember/component'; | |
import fade from 'ember-animated/transitions/fade'; | |
export default Component.extend({ | |
fade, | |
fadeMessage: false, | |
mail: "Hello", | |
}); |
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
exports.default = Ember.Component.extend({ | |
layout: _animatedEach.default, | |
tagName: '', | |
motionService: Ember.inject.service('-ea-motion'), | |
/** | |
* The list of data you are trying to render. | |
@argument items | |
@type Array | |
*/ |
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({ | |
// this component only received args from the caller | |
// but it does track its own local info property | |
info: '', // initial form field 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.Component.extend({ | |
clickCounter: 0, | |
click() { | |
this.set('clickCounter', this.clickCounter + 1); | |
} | |
}); |
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 Component from '@ember/component'; | |
import { action, computed } from '@ember-decorators/object'; | |
import { check } from 'twiddle/utils/tree-helpers'; | |
export default class extends Component { | |
options = [{ | |
id: 1, | |
label: 'burger', | |
checked: false, |
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', | |
someBool: true, | |
init() { | |
this._super(...arguments); |