簡體   English   中英

AngularJS-Modify NgBoilerPlate模板來修改網頁標題

[英]AngularJS-Modify NgBoilerPlate template to modify the title of the webpage

已經從https://github.com/ngbp/ngbp下載了NgBoilerPlate。 使用它作為模板來構建網站。 流程如下-

index.html

 <li ui-sref-active="active">
              <a href ui-sref="home">
                <i class="fa fa-home"></i>
                Home
              </a>
            </li>

app.js

angular.module( 'ngBoilerplate', [
  'templates-app',
  'templates-common',
  'ngBoilerplate.home',
  'ngBoilerplate.about',
'ui.router'
])

Home.js

angular.module( 'ngBoilerplate.home', [
  'ui.router',
  'plusOne'
])

/**
 * Each section or module of the site can also have its own routes. AngularJS
 * will handle ensuring they are all available at run-time, but splitting it
 * this way makes each module more "self-contained".
 */
.config(function config( $stateProvider ) {
  $stateProvider.state( 'home', {
    url: '/home',
    views: {
      "main": {
        controller: 'HomeCtrl',
        templateUrl: 'home/home.tpl.html'
      }
    },
    data:{ pageTitle: 'Home' }
  });
})

現在,當單擊homeTab時-標題顯示為Home | ngBoilerplate

如何從標題中除去| ngBoilerPlate

謝謝

  1. 轉到此鏈接

  2. 您需要更改的是第19行

    $scope.pageTitle = toState.data.pageTitle + ' | ngBoilerplate' ;

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM