本文整理匯總了TypeScript中@angular/platform-browser.Title.setTitle方法的典型用法代碼示例。如果您正苦於以下問題:TypeScript Title.setTitle方法的具體用法?TypeScript Title.setTitle怎麽用?TypeScript Title.setTitle使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類@angular/platform-browser.Title
的用法示例。
在下文中一共展示了Title.setTitle方法的10個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: setTitle
private setTitle(){
if(this.t.langInitialized){
if(this.isCurrentUser)
this.titleService.setTitle(this.t._.collection.my_title);
else
this.titleService.setTitle(this.t.format(this.t._.collection.belongs_to_title, [this.user.name]));
}
}
示例2: ga
router.events.filter(e => e instanceof NavigationEnd).subscribe((n: NavigationEnd) => {
ga('send', 'pageview', n.urlAfterRedirects);
let pageTitle = router.routerState.snapshot.root.children[0].data['title'];
if(pageTitle) {
title.setTitle(pageTitle);
} else {
title.setTitle("Angular Community");
}
});
示例3: ngOnInit
ngOnInit() {
if (!this.embedded) {
if (this.vic) {
this.title.setTitle("vSphere Integrated Containers");
document.getElementById('appFavicon').setAttribute('href', '../assets/images/vic-favicon.ico');
} else {
this.title.setTitle("Admiral");
document.getElementById('appFavicon').setAttribute('href', '../assets/images/favicon.ico');
}
}
}
示例4: switch
this._router.events.subscribe((event) => {
if (event instanceof NavigationEnd) {
switch (event.urlAfterRedirects) {
case '/':
this._title.setTitle('Home Page');
this._meta.updateTag({ name: 'description', content: 'Home Page Description' });
break;
case '/about':
this._title.setTitle('About Page');
this._meta.updateTag({ name: 'description', content: 'About Page Description' });
break;
}
}
});
示例5: constructor
constructor(private title : Title,
private synchroRunningService : SynchroRunningService,
private route: ActivatedRoute,
private location: Location,
private synchroFilesService : SynchroFilesService) {
title.setTitle("SyncFiles - Detail");
}
示例6: constructor
constructor(private titleService: Title, private monstersService: MonstersService, private router : Router) {
this.titleService.setTitle( "d20Site - Find Monsters" );
this.findService = monstersService.getFindService();
monstersService.findResults().subscribe((miniatures : Miniature[]) => {
this.monsterMiniatures = miniatures;
});
}
示例7: generateTags
generateTags(tags) {
// defaults
tags = {
title: 'Titel der Seite',
description: 'Beschreibung der Seite',
image: '',
slug: '',
...tags
};
this.titleService.setTitle(tags.title);
this.meta.updateTag({ name: 'twitter:card', content: 'summary' });
this.meta.updateTag({ name: 'twitter:site', content: '@sfwinterbach' });
this.meta.updateTag({ name: 'twitter:title', content: tags.title });
this.meta.updateTag({ name: 'twitter:description', content: tags.description });
this.meta.updateTag({ name: 'twitter:image', content: tags.image });
this.meta.updateTag({ name: 'og:type', content: 'summary' });
this.meta.updateTag({ name: 'og:site_name', content: 'SF Winterbach e.V.' });
this.meta.updateTag({ name: 'og:title', content: tags.title });
this.meta.updateTag({ name: 'og:description', content: tags.description });
this.meta.updateTag({ name: 'og:image', content: tags.image });
this.meta.updateTag({ name: 'og:url', content: 'www.SEOSERVICE.de' });
}
示例8: onClick
@HostListener('click', ['$event'])
onClick(event: MouseEvent) {
event.preventDefault();
event.stopPropagation();
this.service.setTitle(this.pageTitle);
}
示例9: constructor
constructor(
private theService:FM5NoEncontradoService,
meta: Meta,
title: Title
) {
title.setTitle('Error 404 - Fermoto5HD');
}
示例10: constructor
constructor(private socketService: SocketService,
private appContext: AppContextService,
private userService: UserService,
private router: Router,
title: Title) {
title.setTitle("Desktop Chat");
}