matth3o matth3o - 6 months ago 68
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.


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();