I am trying to make something work on angular2 and I am unable to find something about this behavior.
I have an application that implements a custom component like this
What I do is use a property, so when I change the data the change is emitted automatically
private _data: AnyType;
@Input() get data(): AnyType{
return this._data;
}
set data(value: AnyType) {
this._data = value;
this.dataChange.emit(this._data);
}
@Output() dataChange: EventEmitter = new EventEmitter();
In html you will bind the property using [(data)]