I’ve checked the version of aurelia I’m using - aurelia@2.0.0-alpha.23
‘main.ts’ is bare minimum.
Could it be that I’m using EventAggregator elsewhere in the app? To get around the problem of @observable propertyChanged not firing while watching a property in a service, I used EA to manually fire events. I messed around for days, because I was injecting @IEventAggregator ea:IEventAggregator into the ctor of the service. While the rest of the app could subscribe and publish to ea, the events weren’t firing.
After much head-scratching I changed all references in the app from IEventAggregator to EventAggregtor and lo and behold the events all started firing.
import { observable } from "@aurelia/runtime";
export class AdminPage {
@observable watchMe = "Hello";
// doesn't fire
watchMeChanged(val: string) {
console.log(val);
}
btnClick() {
this.watchMe = "Great - working fine";
}
}