dimanche 8 février 2015

How to declare observables or computed properties in Ember using ES6?

Trying to use ES6 for all of my Ember work. I have the following ES6 syntax issue:


How do I convert standard ES5 object literal computed property to ES6 syntax?


ES5:



export default Ember.Controller.extend({
foo: function() {
return "bar";
}.property()
});


ES6:



export default Ember.Controller.extend({
foo() {
return "bar"
}.property()
});


What I have so far does not seem to work because .property is not referenced correctly. How is this achieved?





Aucun commentaire:

Enregistrer un commentaire