https://github.com/angular/angular
Raw File
Tip revision: 9c486c96827a9282cbdbff176761bc95554a260b authored by Matthieu Riegler on 11 February 2024, 00:16:49 UTC
fix(http): Use string body to generate transfer cache key. (#54379)
Tip revision: 9c486c9
mode-banner.component.ts
import { Location } from '@angular/common';
import { Component, Input } from '@angular/core';
import { VersionInfo } from 'app/navigation/navigation.service';

@Component({
  selector: 'aio-mode-banner',
  template: `
    <div *ngIf="mode === 'archive'" class="mode-banner alert archive-warning">
      <p>
        This is the <strong>archived documentation for Angular v{{ version.major }}.</strong> Please visit
        <a href="https://angular.io{{currentPath}}?redirected_from={{version.major}}">angular.io</a>
         to see this page for the current version of Angular.
      </p>
    </div>
  `,
})
export class ModeBannerComponent {
  @Input() mode: string;
  @Input() version: VersionInfo;

  currentPath: string;

  constructor(private location: Location) {
    this.currentPath = this.location.path();
  }
}
back to top