在 DurandalJS 中,我在 ViewModel 中创建了一个 Activator,它将与 View 中的 Compose Binding 绑定。简单的例子:
var ViewModel = function(){
this.childView = activator.create();
this.activate = function(whyIsThisUndefined){ console.error('Well?' + whyIsThisUndefined); }
}
<div data-bind="compose: { model : theModel, activationData: [1]}"></div>
我究竟做错了什么?为什么 Durandal 不传递激活参数?