[AngularJS] Set HTML Document Title


In pure JavaScript, the following way can be used to set HTML document title:

document.title = "myTitle";

However, this is not Angular way of doing programming, AngularJS provide $document for programmers to deal with HTML document. So I use the following syntax to set HTML document title:

$document.title = "myTitle"; // this doesn't work

But it does not work. Finally I found the correct way to set HTML document:

$document.prop('title', 'myTitle');

For those who has the same problem as me.