2016-03-21 7 views
0

NgBoilerPlate von https://github.com/ngbp/ngbp heruntergeladen haben. Verwenden Sie es als Vorlage zum Erstellen einer Website. Die Strömung ist als folgt-AngularJS-Ändern Sie NgBoilerPlate Vorlage, um den Titel der Webseite zu ändern

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

Wenn nun die Hometab clicked- ist der Titel als Startseite gezeigt | ngBoilerplate

Wie loswerden | ngBoilerPlate aus dem Titel.

Dank

Antwort

1
  1. Gehe zu dieser link

  2. Was Sie ändern müssen, ist die Zeilennummer 19

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

+0

dank ........ .. – Rehan

+0

@Rehan Hier im Stack-Overflow stimmen wir ab anstatt zu danken:) – Abhi

Verwandte Themen