Hello!
I want to modify controller with plugin api, but it failed with a warning like:
[THEME xxx] “controller:full-page-search” was already cached in the container. Changes won’t be applied.
my code:
function modifySearchTypes(api) {
api.modifyClass("controller:full-page-search", {
pluginId: "modify-search-types",
init() {
this._super(...arguments);
this.set("searchTypes", [
{ name: I18n.t("search.type.default"), id: SEARCH_TYPE_DEFAULT },
{
name: this.siteSettings.tagging_enabled
? I18n.t("search.type.categories_and_tags")
: I18n.t("search.type.categories"),
id: SEARCH_TYPE_CATS_TAGS,
},
]);
this.selected = [];
},
});
}
export default {
name: "modify-search-types",
initialize() {
withPluginApi("0.10.0", modifySearchTypes);
},
};
How can I deal with it?
Thank you very much!