Hello,
I’m trying to observe changes to the model of the EditCategoryTabs controller but for some reasons, nothing happens:
import { observes } from "@ember-decorators/object"
import { withPluginApi } from "discourse/lib/plugin-api"
function initialize(api) {
api.modifyClass(
"controller:edit-category.tabs",
(Superclass) =>
class extends Superclass {
@observes("model.parent_category_id")
onParentCategoryChange() {
console.log("Apply some logic here when parent category changes");
}
}
);
}
export default {
name: "new-category-permissions",
initialize() {
withPluginApi(initialize);
},
}
I tried many things but I’m still not able to trigger the observer callback when the model changes. Anything I missed that might explain how to this correctly?
For the context, I’m using Discourse 3.5.1 built with official launcher.
Thanks for your help!