Angular 2 @Output parameters -


im trying pass parameters through @output fired function receive 'undefined'. can please show me way pass parameters through eventemitter of @output? example:

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 undefined!!                 }              }); 

you shoud use following value provided event:

<child-cmp (myevent)="invoke($event.value)"'></child-cmp>' 

this way invoke method of childcmp receive parameter value provide when emitting myevent custom event.

hope helps you, thierry


Comments

Popular posts from this blog

sql - VB.NET Operand type clash: date is incompatible with int error -

SVG stroke-linecap doesn't work for circles in Firefox? -

python - TypeError: Scalar value for argument 'color' is not numeric in openCV -