matth3o matth3o - 1 year ago 171
Dart Question

dart angular2 - two-ways binding in component

Is there a way to bind a field in a component as input and output ?


<my-component [(innerComponentField)]="outerComponentField"></my-component>

Thanks for your help.

Answer Source

For [] the component needs a matching @Input() For () it needs a matching @Output().

There is no way to do both with just an @Input()

The combination [(innerComponentFields)] requires

@Input() dynamic innerComponentField;
@Output() EventEmitter innerComponentFieldChange = new EventEmitter();
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download