Created
May 30, 2020 17:15
-
-
Save jjff/e4fc12c3674c3097acc661d9261136b1 to your computer and use it in GitHub Desktop.
New Twiddle
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 Controller from '@ember/controller'; | |
import { map } from '@ember/object/computed'; | |
export default class ApplicationController extends Controller { | |
appName = 'Ember Twiddle' | |
chores = ['clean', 'write more unit tests'] | |
@map('chores', function(e, i) { | |
return `${e.toUpperCase()}_${i+1}!`; | |
}) | |
excitingChores; | |
} |
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 { set } from '@ember/object'; | |
import { map } from '@ember/object/computed'; | |
class Hamster { | |
constructor(chores) { | |
set(this, 'chores', chores); | |
} | |
@map('chores', function(chore, index) { | |
return `${chore.toUpperCase()}!`; | |
}) | |
excitingChores; | |
}); | |
let hamster = new Hamster(['clean', 'write more unit tests']); | |
hamster.excitingChores; // ['CLEAN!', 'WRITE MORE UNIT TESTS!'] | |
*/ |
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 Application from '../app'; | |
import config from '../config/environment'; | |
import { setApplication } from '@ember/test-helpers'; | |
import { assign } from '@ember/polyfills'; | |
import { start } from 'ember-qunit'; | |
let attributes = { | |
rootElement: '#test-root', | |
autoboot: false | |
}; | |
attributes = assign(attributes, config.APP); | |
let application = Application.create(attributes); | |
setApplication(application); | |
start(); |
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
{ | |
"version": "0.17.1", | |
"EmberENV": { | |
"FEATURES": {}, | |
"_TEMPLATE_ONLY_GLIMMER_COMPONENTS": false, | |
"_APPLICATION_TEMPLATE_WRAPPER": true, | |
"_JQUERY_INTEGRATION": false | |
}, | |
"options": { | |
"use_pods": false, | |
"enable-testing": false | |
}, | |
"dependencies": { | |
"ember": "3.18.1", | |
"ember-template-compiler": "3.18.1", | |
"ember-testing": "3.18.1" | |
}, | |
"addons": { | |
"@glimmer/component": "1.0.0" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment