I’m just wondering why fat arrow functions don’t work with computed properties. For instance:
export default Ember.Component.extend({
title: null,
items: null,
classNames: ['menu-section'],
hasTitle: () => {
return this.get('title').length > 0;
}.property('title')
});
Will result in the following error:
Uncaught TypeError: Cannot read property ‘get’ of undefined
I’m curious as to why this would fail? I understand that it doesn’t include the lexical ‘this’ property, but how come regular functions do? It seems like both would result in undefined. Or, is there some special magic happening in Babel that I don’t know about?