Updating HTML Page Title By Passing Angular JS Directive Value in JavaScript script tag

I am trying to update the page title dynamically by creating a pageTitle directive and passing it in the <script> tag.

I know I can do which works

<title page-title></title>

but I am trying to do <script type="text/javascript">document.title='{{page-title}}'</script>

It shows me 0 as Title

Source: AngularJS