Ember computed alias on array firstObject not working

本小妞迷上赌 提交于 2019-12-12 06:18:39

问题


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.

来源:https://stackoverflow.com/questions/44192637/ember-computed-alias-on-array-firstobject-not-working

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!