Forked from NullVoxPopuli/controllers.application.js
Last active
September 24, 2018 13:49
-
-
Save Gaurav0/5837aa39c1cb53be16caa941d9b68147 to your computer and use it in GitHub Desktop.
Action Test w/ ES Classes
This file contains 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 { action } from '@ember-decorators/object'; | |
// decorators and class properties are not supported by twiddle | |
export default class extends Controller { | |
appName = 'Ember Twiddle'; | |
constructor() { | |
super(...arguments); | |
this.appName = 'Ember Twiddle'; | |
this.classProperty = () => { | |
console.log('classProperty', this.appName); | |
} | |
} | |
classProperty = () => { | |
console.log('classProperty', this.appName); | |
} | |
func() { | |
console.log('func', this.appName); | |
} | |
@action | |
decorated() { | |
console.log('decorated', this.appName); | |
} | |
actions = { | |
traditionalAction() { | |
console.log('traditionalAction', this.appName); | |
} | |
} | |
} |
This file contains 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.15.0", | |
"EmberENV": { | |
"FEATURES": {} | |
}, | |
"options": { | |
"use_pods": false, | |
"enable-testing": false | |
}, | |
"dependencies": { | |
"jquery": "https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.js", | |
"ember": "3.2.2", | |
"ember-template-compiler": "3.2.2", | |
"ember-testing": "3.2.2" | |
}, | |
"addons": { | |
"ember-data": "3.1.1", | |
"ember-decorators": "2.0.0" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment