Skip to content

Instantly share code, notes, and snippets.

Eric Kelly HeroicEric

Block or report user

Report or block HeroicEric

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View controllers.application.js
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle'
});
View controllers.application.js
import Ember from 'ember';
import { A } from '@ember/array';
import EmberObject, { computed } from '@ember/object';
export default Ember.Controller.extend({
displayData: Ember.computed('data.@each.priority', function() {
return this.data.sort((a, b) => a.priority - b.priority);
}),
data: A([
View components.paginated-list.js
import Ember from 'ember';
import { get, set } from '@ember/object';
export default Ember.Component.extend({
perPage: 2,
pageNumber: 1,
paginatedData: Ember.computed('data.[]', 'perPage', 'pageNumber', function() {
let { data, perPage, pageNumber } = this.getProperties('data', 'perPage', 'pageNumber');
View components.my-component.js
import Ember from 'ember';
import { inject as service } from '@ember/service';
export default Ember.Component.extend({
myService: service()
});
View controllers.application.js
import Ember from 'ember';
const COUNTRIES = [
{ name: 'Iceland', code: 'IS' },
{ name: 'Germany', code: 'DE' },
{ name: 'Greece', code: 'GR' },
{ name: 'Spain', code: 'ES' }
];
export default Ember.Controller.extend({
View controllers.application.js
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle',
actions: {
derp() {
confirm("Are you sure?");
}
}
View components.my-component.js
import Ember from 'ember';
export default Ember.Component.extend({
hideButton: true
});
View controllers.application.js
import Ember from 'ember';
export default Ember.Controller.extend({
derp: Ember.computed({
get() {
return 'hello';
},
set(key, value) {
return 'foo';
}
View controllers.application.js
import Ember from 'ember';
export default Ember.Controller.extend({
foo: true,
bar: false
});
View components.first-name-editor.js
import Ember from 'ember';
export default Ember.Component.extend({
});
You can’t perform that action at this time.