Skip to content

Instantly share code, notes, and snippets.

import Ember from 'ember';
export default Ember.Component.extend({
});
@camskene
camskene / controllers.application.js
Created October 3, 2018 14:13 — forked from vitch/controllers.application.js
Ember - Return Promise from Computed Property
import Ember from 'ember';
export default Ember.Controller.extend({
shouldRenderComponent: false,
actions: {
renderComponent() {
this.toggleProperty('shouldRenderComponent');
},
},
@camskene
camskene / controllers.application.js
Created October 3, 2018 12:53
Ember - Return Promise from Computed Property
import Ember from 'ember';
export default Ember.Controller.extend({
shouldRenderComponent: false,
actions: {
renderComponent() {
this.toggleProperty('shouldRenderComponent');
},
},
@camskene
camskene / a.controller.js
Created August 13, 2018 01:27
New Twiddle
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle',
items: Ember.computed(function() {
return [
{
title: 'item 1',
},
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle',
activeItem: undefined,
items: Ember.computed(function() {
return [
{
title: 'Item 1',
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Template Switcher',
template: null,
actions: {
setTemplate(template) {
this.set('template', template);
},
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle',
accordion: Ember.inject.service(),
actions: {
expandAll() {
let accordion = this.get('accordion');
console.log('accordion', accordion);
console.log('expand all');
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle',
accordion: Ember.inject.service(),
actions: {
expandAll() {
let accordion = this.get('accordion');
console.log('accordion', accordion);
console.log('expand all');
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle',
myAccordianConfig: Ember.computed(function() {
return [
{
label: 'numero uno',
isExpanded: false,
import Ember from 'ember';
export default Ember.Component.extend({
configuration: undefined,
actions: {
onExpand(item) {
item.toggleProperty('isExpanded');
},
},
});