jeudi 25 mai 2017

Ember computed alias on array firstObject not working

I have this computed property alias in my component:

firstElement: Ember.computed.alias('myArray.firstObject')

This works in development, but doesn't update in production mode.

This code though works in both development and production:

firstElement: Ember.computed('myArray.[]', function() {
  return this.get('myArray.firstObject');
}

Is the alias macro not allowed on firstObject , lastObject, etc..?

It also seems weird that in works in development but not in production mode.




Aucun commentaire:

Enregistrer un commentaire