How to add dynamic tab title in angularjs?

Issue

This Content is from Stack Overflow. Question asked by Anu25

I am having a common title for all the tabs i.e, “My App”. But I want to make dynamic tab titles for the page I navigate into. Here’s the reference code for that which is in angular js,

(function (angular) {
'use strict';
controllers.controller("page1",['$scope','$rootscope','$parse','$compile','$state','CommonService',
function($scope,$rootscope,$parse,$compile,$state,'CommonService'){
$rootScope.users = {};
$scope.Users = {};
$scope.selectedUsers = " ";
$scope.AssignComments;
$rootScope.pageTitle = "Page1";
}}

For this the tab title is showing as “My App”. But I want to make it dynamic, how can I do that?



Solution

This question is not yet answered, be the first one who answer using the comment. Later the confirmed answer will be published as the solution.

This Question and Answer are collected from stackoverflow and tested by JTuto community, is licensed under the terms of CC BY-SA 2.5. - CC BY-SA 3.0. - CC BY-SA 4.0.

people found this article helpful. What about you?