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.

3
  • Possible duplicate of Updating title tag using AngularJS and UI-Router Commented Aug 8, 2016 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 Commented Aug 8, 2016 at 11:19
  • please check: github.com/nonplus/angular-ui-router-title $stateProvider .state('home', { ... resolve: { // Constant title $title: function(val) { return val; } } }) Commented Aug 8, 2016 at 12:10

1 Answer 1

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

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.