A transition can happen within the same route, e. g. when query params change or a route segment changes.
We properly update metaInfo:
afterModel(model: ProjectsProjectRouteModel): void {
this.metaInfo = {
title: model.project.attributes.metaTitle ?? model.project.attributes.companyName,
description: model.project.attributes.projectType,
imgSrc: model.project.attributes.hero,
};
}
But the headData service ignores that because it only observes changes to routeName:
https://github.com/shipshapecode/ember-meta/blob/main/addon/services/head-data.js#L16
My workaround is to do this after updating this.metaInfo:
notifyPropertyChange(this.headData, 'routeName');
}
This obviously is uboptimal. Changes to metaInfo should be tracked. Or it could be a method call, e. g. this.headData.setMetaInfo({})....
A transition can happen within the same route, e. g. when query params change or a route segment changes.
We properly update
metaInfo:But the
headDataservice ignores that because it only observes changes torouteName:https://github.com/shipshapecode/ember-meta/blob/main/addon/services/head-data.js#L16
My workaround is to do this after updating
this.metaInfo:This obviously is uboptimal. Changes to
metaInfoshould be tracked. Or it could be a method call, e. g.this.headData.setMetaInfo({})....