Controller.js
Angular.module (' myApp ', []) </span>
run ([' $location ', ' $rootScope ', function ($location, $rootScope) {
$rootScope. $on (' $stateChangeSuccess ', function (event, tostate, Toparams, FromState, Fromparams) {
$ Rootscope.title = Tostate.title
});
Router.js
$stateProvider
. State (' Global.search ', {
title: ' Here's the title of each page ',
URL: '/global/search?q& Company&user®ion&account_type&call_type®istered ', views
: {
' main ': {
TEMPLATEURL:HELPER.GETURL (' Global.search '),
controller: ' Searchctrl ',
}
}
}
Index.html
<!doctype html>
. config (function ($stateProvider, $urlRouterProvider) {
$urlRouterProvider. Otherwise ('/home ');
$stateProvider
. State (' home ', {
URL: '/home ',
templateurl: ' views/home.html ',
data: {pagetitle: ' Home '}
}
. State (' about ', {
URL: '/about ',
templateurl: ' views/about.html ',
data: {pagetitle: ' About '}}}
);
Controller.js
$rootScope. $on ("$routeChangeSuccess", Function (Currentroute, previousroute) {
$rootScope. PageTitle = $ Route.current.data.pageTitle;
});
Index.html
<title ng-bind= "<span style=" font-family:arial, Helvetica, Sans-serif; >pageTitle</span> "></title>