如何使用AngularJS在标签中隐藏{{title}} ?

时间:2021-11-23 20:35:57

I want to dynamically update the <title> of my page based on which route / page a user is viewing. Problem is, when the page loads, for a few seconds it shows {{title}} inside my <title> tag where it later puts in the title of the current page (loaded from the controller). Any way I could have the {{title}} hidden by default until the value is loaded?

我想根据用户正在查看的路径/页面动态更新页面的

。问题是,当页面加载时,它会在我的 标记中显示{{{{title}}},然后将其放入当前页面的标题(从控制器加载)。是否可以默认隐藏{{{title},直到值被加载?</p>

1 个解决方案

#1


71  

Use ngBind on the <title> element:

元素上使用ngBind:</p>
<title ng-bind="title"> Default title </title>

#1


71  

Use ngBind on the <title> element:

元素上使用ngBind:</p>
<title ng-bind="title"> Default title </title>