当前位置: 首页>>代码示例>>TypeScript>>正文


TypeScript Title.setTitle方法代码示例

本文整理汇总了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]));
     }
 }
开发者ID:OlivierCoue,项目名称:invow,代码行数:8,代码来源:tc-collection-user-all.component.ts

示例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");
     }
 });
开发者ID:chuckjaz,项目名称:ames,代码行数:9,代码来源:ames.component.ts

示例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');
         }
     }
 }
开发者ID:mdharamadas1,项目名称:admiral,代码行数:11,代码来源:app.component.ts

示例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;
     }
   }
 });
开发者ID:ranavc32,项目名称:AngularUniversal-localStorage,代码行数:14,代码来源:app.component.ts

示例5: constructor

 constructor(private title : Title,
             private synchroRunningService : SynchroRunningService,
             private route: ActivatedRoute,
             private location: Location,
             private synchroFilesService : SynchroFilesService) {
     title.setTitle("SyncFiles - Detail");
 }
开发者ID:fensminger,项目名称:SyncFiles,代码行数:7,代码来源:synchro_detail.ts

示例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;
    });
 }
开发者ID:Gettor,项目名称:d20Site,代码行数:7,代码来源:find-monsters.component.ts

示例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' });
  }
开发者ID:Meistercoach83,项目名称:sfw,代码行数:25,代码来源:seo.service.ts

示例8: onClick

  @HostListener('click', ['$event'])
  onClick(event: MouseEvent) {
    event.preventDefault();
    event.stopPropagation();

    this.service.setTitle(this.pageTitle);
  }
开发者ID:chriswoodley,项目名称:cwoodley-com,代码行数:7,代码来源:page-title.directive.ts

示例9: constructor

	constructor(
		private theService:FM5NoEncontradoService,  
		meta: Meta, 
		title: Title
	) {
		title.setTitle('Error 404 - Fermoto5HD');
	}
开发者ID:Fermoto5HD,项目名称:SitioPersonal,代码行数:7,代码来源:landing.component.ts

示例10: constructor

	constructor(private socketService: SocketService,
		private appContext: AppContextService,
		private userService: UserService,
		private router: Router,
		title: Title) {
		title.setTitle("Desktop Chat");
	}
开发者ID:bfsmith,项目名称:desktop-chat,代码行数:7,代码来源:register.component.ts


注:本文中的@angular/platform-browser.Title.setTitle方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。