To update the page title, use the function
titleService.setPageTitle("My Title");
within a controller as shown below:
<!DOCTYPE html>
<html ng-app="myApp">
<head>
<script data-require="<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="22484b43415845440d494052664644184943">[email protected]</a>" src="https://code.angularjs.org/1.3.20/angular.js" data-semver="1.3.20"></script>
<script>
var app = angular.module('myApp', []);
app.controller('MainController', function($scope, titleService) {
titleService.setPageTitle('New Page Title');
})
.factory("titleService", function($window) {
return {
setPageTitle: function(title) {
$window.document.title = title;
}
};
});
</script>
</head>
<body ng-controller="MainController">
<p>Successfully changed the page title to "New Page Title"!</p>
</body>
</html>