Internet explorer 8 internet explorer 8中标题标记中的角度表达式不工作

Internet explorer 8 internet explorer 8中标题标记中的角度表达式不工作,internet-explorer-8,angularjs,Internet Explorer 8,Angularjs,我想显示通过角度渲染的标题。它在chrome或firefox等浏览器以及internet 9和10中都能正常工作 ng应用程序在html标记中定义 标题标签如下所示: <title> {{resultListQuery.selectedPropertiesSummary}} in {{resultListQuery.geoCodingResult.locationName}} </title> {{resultListQuery.geoCodingResult

我想显示通过角度渲染的标题。它在chrome或firefox等浏览器以及internet 9和10中都能正常工作

ng应用程序在html标记中定义

标题标签如下所示:

<title>    
{{resultListQuery.selectedPropertiesSummary}} in {{resultListQuery.geoCodingResult.locationName}}
</title>

{{resultListQuery.geoCodingResult.locationName}中的{{resultListQuery.selectedPropertiesSummary}}
有人能帮我吗?您需要有关该应用程序的更多信息吗?

您必须使用:

<title ng-bind-template="foo {{pageTitle}} bar"></title>


或者,您也可以使用
ng bind
,但是
ng bind template
还有一个额外的优点,它允许您在其中包含多个
{}
表达式。

您可以使用
$window.document.title
设置标题而不进行绑定。

这是跨浏览器解决方案。ng bind和ng bind模板永远不会工作,因为它们使用的是element.text(),而在IE8上它永远不会工作

myModule.run(function($interpolate, $window) {
   ...
   $rootScope.$watch(function() {
      return $interpolate(myTitleTemplate)($myScope);
   }, function(title) {
      $window.document.title = title;
   })
   ...
});

最坏的情况是可能会从controller=>
angular.element('title').text(var1+'in'+var2)
更改标题。我已经纠正了一个拼写错误,请您再试一次。Uri显示在选项卡中,而不是我的标题。我建议您就此打开一个新问题,由于这里的讨论有点冗长……不幸的是,这个答案得到了否定的评价,而实际上它是唯一正确的答案!{…}}只是在IE8中更新头失败(以及ng bind模板或ng bind),但是$window.document.title在所有浏览器中都有效。