我试图通过@Output传递参数,但被激活的函数只是接收’undefined’.有人可以告诉我通过@Output的EventEmitter传递参数的方法吗?例如:
var childCmp = ng.core.Component({ selector:'child-cmp',outputs: ['myEvent'] }).Class({ constructor: function(){ this.myEvent = new ng.core.EventEmitter(); this.myEvent.emit(false); } }); var parentCmp = ng.core.Component({ selector:'parent-cmp',template:'<child-cmp (myEvent)="invoke()"'></child-cmp>',directives: [childCmp] }).Class({ constructor:function(){},invoke: function(flag){ // here flag is undefined!! } });