UNPKG

@ng-arthur/core

Version:

@ng-arthur/core for Angular 8+ Components

37 lines (36 loc) 1.07 kB
import { Injector, OnDestroy } from '@angular/core'; import { Title } from '@angular/platform-browser'; export declare class NaTitleService implements OnDestroy { private injector; private title; private doc; private _prefix; private _suffix; private _separator; private _reverse; private _default; private i18n$; constructor(injector: Injector, title: Title, doc: any); /** 设置分隔符 */ separator: string; /** 设置前缀 */ prefix: string; /** 设置后缀 */ suffix: string; /** 设置是否反转 */ reverse: boolean; /** 设置默认标题名 */ default: string; private getByElement; private getByRoute; private getByMenu; /** * 设置标题,若不指定具体名称,则按以顺序获取: * - 路由配置 `{ data: { title: 'page name' } }` * - 根据当前 URL 解析菜单数据 * - 页面 `content__title` 中获取 `h1` 内容 * - 默认标题名 */ setTitle(title?: string | string[]): void; ngOnDestroy(): void; }