Reputation: 852
I want to display a title rendered via angular. It works fine in browsers like chrome or firefox and also in internet 9 and 10.
The ng-app is defined in the html tag.
The title tag looks like this:
<title>
{{resultListQuery.selectedPropertiesSummary}} in {{resultListQuery.geoCodingResult.locationName}}
</title>
Can anyone help me please? Do you need more informations about the app?
Upvotes: 3
Views: 1474
Reputation: 13296
You can use $window.document.title
to set your title without binding.
Upvotes: 5
Reputation: 402
This is the cross browser solution. ng-bind and ng-bind-template would never work because they use element.text(), which never works with on IE8.
myModule.run(function($interpolate, $window) {
...
$rootScope.$watch(function() {
return $interpolate(myTitleTemplate)($myScope);
}, function(title) {
$window.document.title = title;
})
...
});
Upvotes: 1
Reputation: 150624
You have to use:
<title ng-bind-template="foo {{pageTitle}} bar"></title>
Alternatively you may also use ng-bind
, but ng-bind-template
has the additional advantage that it allows you to have multiple {{}}
expressions within.
Upvotes: 1