Repository: angular/angular
File: adev/src/app/core/services/a-dev-title-strategy.ts (TypeScript)

Code before:
export const ROUTE_PARENT_PROPERTY = 'parent';
export const TITLE_SUFFIX = 'Angular';
export const TITLE_SEPARATOR = ' • ';
export const DEFAULT_PAGE_TITLE = 'Overview';

export const TITLE_META_TAG = 'title';
export const TITLE_OG_META_TAG = 'og:title';
export const TITLE_TWITTER_META_TAG = 'twitter:title';

export const ALL_TITLE_META_TAGS = [TITLE_META_TAG, TITLE_OG_META_TAG, TITLE_TWITTER_META_TAG];

@Injectable({providedIn: 'root'})
export class ADevTitleStrategy extends TitleStrategy {
  private readonly title = inject(Title);
  private readonly meta = inject(Meta);

  constructor() {
    super();
  }

  override updateTitle(routerState: RouterStateSnapshot) {
    const title = this.buildTitle(routerState);

    if (title !== undefined) {
      this.title.setTitle(title);
      ALL_TITLE_META_TAGS.forEach((tag) => this.meta.updateTag({name: tag, content: title}));
    }
  }

  override buildTitle(snapshot: RouterStateSnapshot): string {
    let route: ActivatedRouteSnapshot = snapshot.root;

    while (route.firstChild) {
      route = route.firstChild;
    }

    const data = route.data as NavigationItem;
    const routeTitle = data.label ?? '';

    const prefix =
      routeTitle.startsWith(DEFAULT_PAGE_TITLE) && data.parent
        ? `${data.parent.label}${TITLE_SEPARATOR}`
        : '';

    return !!routeTitle ? `${prefix}${routeTitle}${TITLE_SEPARATOR}${TITLE_SUFFIX}` : TITLE_SUFFIX;
  }
}


Review comment (suggestion):
```suggestion
      ALL_TITLE_META_TAGS.forEach((tag) => this.meta.updateTag({property: tag, content: title}));
```

It looks like you changed the implementation after creating the screenshots. 
`og:title` and `twitter:title` are the value for `property` not `name`. (at least that's what we have in `adev/src/index.html`)

Code after:
export const ROUTE_PARENT_PROPERTY = 'parent';
export const TITLE_SUFFIX = 'Angular';
export const TITLE_SEPARATOR = ' • ';
export const DEFAULT_PAGE_TITLE = 'Overview';

export const TITLE_OG_META_TAG = 'og:title';
export const TITLE_TWITTER_META_TAG = 'twitter:title';

export const ALL_TITLE_META_TAGS = [TITLE_OG_META_TAG, TITLE_TWITTER_META_TAG];

@Injectable({providedIn: 'root'})
export class ADevTitleStrategy extends TitleStrategy {
  private readonly title = inject(Title);
  private readonly meta = inject(Meta);

  constructor() {
    super();
  }

  override updateTitle(routerState: RouterStateSnapshot) {
    const title = this.buildTitle(routerState);

    if (title !== undefined) {
      this.title.setTitle(title);
      ALL_TITLE_META_TAGS.forEach((tag) => this.meta.updateTag({property: tag, content: title}));
    }
  }

  override buildTitle(snapshot: RouterStateSnapshot): string {
    let route: ActivatedRouteSnapshot = snapshot.root;

    while (route.firstChild) {
      route = route.firstChild;
    }

    const data = route.data as NavigationItem;
    const routeTitle = data.label ?? '';

    const prefix =
      routeTitle.startsWith(DEFAULT_PAGE_TITLE) && data.parent
        ? `${data.parent.label}${TITLE_SEPARATOR}`
        : '';

    return !!routeTitle ? `${prefix}${routeTitle}${TITLE_SEPARATOR}${TITLE_SUFFIX}` : TITLE_SUFFIX;
  }
}