<title>上的ng-bind不起作用</title>

时间:2014-09-11 10:34:24

标签: angularjs ng-bind

使用1.3.0-rc1(最新版本)。

我试过了:

<title ng-bind="title"></title>

<title>{{title}}</title>

但没有。

如果我在{{title}}的任何地方<body>都可以。

我在做:

app.main.run(function($rootScope) {
    $rootScope.$on('$routeChangeSuccess', function(event, current, previous) {
        if (current.hasOwnProperty('$$route')) {
            $rootScope.title = current.$$route.title;
        }
    });
});

我可以在模型中看到我的title<title>代码发生了什么?

1 个答案:

答案 0 :(得分:5)

通过在ng-app代码上添加<html>来解决此问题。

相关问题