我有以下的道具在我的控制器灰燼 - 觀察與物業衝突
App.TeamController = Ember.ObjectController.extend(
involvedProjectTeams: (->
return @get("content.projectTeams").filter (projectTeam, index, enumerable) ->
projectTeam.get("sdeScopingWeeks") isnt 0
).property("[email protected]")
notInvolvedProjectTeams: (->
return @get("content.projectTeams").filter (projectTeam, index, enumerable) ->
return projectTeam.get("sdeScopingWeeks") is 0
).observes("[email protected]")
)
然後我遍歷都involvedProjectTeams以及底層模板notInvolvedProjectTeams。我收到以下錯誤:
Uncaught TypeError: Object function() {
return this.get("content.projectTeams").filter(function(projectTeam, index, enumerable) {
return projectTeam.get("sdeScopingWeeks") === 0;
});
} has no method 'addArrayObserver'
爲什麼property()按預期工作,但觀察會引發錯誤?
謝謝!