當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。