本文整理汇总了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");
}