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?
You can use $window.document.title to set your title without binding.
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;
})
...
});
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.