0

I am using ui route. I want to set the page title if the title is static or hard code, it's working fine but I want to set the page title based on dynamic state. Here is my code:

    .state('sportsbrief', {
    url: '/sportsbrief',
    controller: 'homeController as home',
    templateUrl: HTML.SPORTS_BRIEF,
    title:"sportsbrief"
  })
  .state('page',{
    url:'/page/:page',
    templateUrl:function(value){
      return"views/"+value.page+".html"
    },
    controller:"staticPageController",
    title:value.page

  })

I want to set the page title for state page.

YasserKaddour
  • 880
  • 11
  • 23
pankaj malik
  • 107
  • 2
  • 15
  • Possible duplicate of [Updating title tag using AngularJS and UI-Router](http://stackoverflow.com/questions/20183222/updating-title-tag-using-angularjs-and-ui-router) – shan kulkarni Aug 08 '16 at 10:32
  • @shankulkarni.....for sportsbrief state page title is appearing, i want to se t for state page on the basis of dynamic url defining in route – pankaj malik Aug 08 '16 at 11:19
  • please check: https://github.com/nonplus/angular-ui-router-title $stateProvider .state('home', { ... resolve: { // Constant title $title: function(val) { return val; } } }) – shan kulkarni Aug 08 '16 at 12:10

1 Answers1

0

You can use angular-ui-router-title in your app which allows dynamic title update. https://github.com/nonplus/angular-ui-router-title

Ref: Updating title tag using AngularJS and UI-Router

Community
  • 1
  • 1
shan kulkarni
  • 849
  • 7
  • 18