1

How can we use ng-bind when there is a concatination of two values with double colons?

<title ng-bind="::AppConfig.SITE_TITLE + ::AppConfig.PAGE_TITLE"></title>

Above code returns this error:

Error: [$parse:syntax] Syntax Error: Token ':' not a primary expression at column 24 of the expression [AppConfig.SITE_TITLE + ::AppConfig.PAGE_TITLE] starting at [::AppConfig.PAGE_TITLE].

Note that this works fine:

<title ng-bind="::AppConfig.SITE_TITLE + ' | This is page title'"></title>
4

2 回答 2

5

尝试:<title ng-bind="::(AppConfig.SITE_TITLE + AppConfig.PAGE_TITLE)"></title>

于 2015-07-26T14:52:23.350 回答
0

可以使用表达式代替 ng-bind

<title>{{::AppConfig.SITE_TITLE}} | {{::AppConfig.PAGE_TITLE}}</title>
于 2015-07-26T14:53:33.743 回答