ui-router-page-title demo


ui-router-page-title

Installation

Installation can be done via package managers such as npm or yarn


  npm install ui-router-page-title --save
  # or
  yarn add ui-router-page-title
          
      

Usage

import the modules required for ui-router-page-title. It is necessary to include ui.router for ui-router-page-title to work


  <script src="angular.min.js"></script>
  <script src="angular-ui-router.min.js"></script>
  <script src="../ui-router-page-title.min.js"></script>
          
      

add the uiRouterTitle dependency to the module


  angular.module('myApp', ['uiRouterTitle']);
          

in your router config


  .state('app.home', {
    url: '/home',
    data: {
      pageTitle: 'Home' // is being set as tilte
    },
    templateUrl: 'templates/home.html',
  });
          
      

in your html add page-title directive


  <title page-title>UI-Router PageTitle </title>