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' }
  });
})

现在单击主页选项卡时- 标题显示为 Home|ngBoilerplate

如何从标题中删除 |ngBoilerPlate

谢谢

  1. 转到这个link

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

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