Skip to content

Ignores transitions within the same route #178

@lolmaus

Description

@lolmaus

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({})....

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions