Hi All.
I am trying to upgrade a plugin from Aurelia 1 to Aurelia 2. In my Aurelia 1 plugin I am using
the BindingEngine
to observe a specific property on a bound object (via bindable). Like this:
import { bindable, BindingEngine, Disposable } from 'aurelia-framework';
@customElement('pagination')
@inject(BindingEngine)
export class PaginationComponent {
@bindable({
defaultBindingMode: bindingMode.twoWay,
changeHandler: 'dataChange'
}) public request: MyRequest;
constructor(
private bindingEngine: BindingEngine
) { }
public attached(): void {
this.bindingEngine
.propertyObserver(this.request, 'currentPage')
.subscribe(() => this.dataChange());
}
private dataChange(): void {
// Logic
}
}
I can’t find anything on that in Aurelia 2 though. Can anyone point me in the right direction?