• 概要
@angular/router

DefaultTitleStrategy

Class

The default TitleStrategy used by the router that updates the title using the Title service.

API

    
      class DefaultTitleStrategy extends TitleStrategy {  constructor(title: Title): DefaultTitleStrategy;  updateTitle(snapshot: RouterStateSnapshot): void;  override buildTitle(snapshot: RouterStateSnapshot): string | undefined;  override getResolvedTitleForRoute(snapshot: ActivatedRouteSnapshot): any;}
    
    

constructor

DefaultTitleStrategy
@paramtitleTitle

updateTitle

void

Sets the title of the browser to the given value.

@paramsnapshotRouterStateSnapshot
@returnsvoid

buildTitle

string | undefined
@paramsnapshotRouterStateSnapshot
@returnsstring | undefined

getResolvedTitleForRoute

any

Given an ActivatedRouteSnapshot, returns the final value of the Route.title property, which can either be a static string or a resolved value.

@returnsany
Jump to details