Html 角度模板变量仅适用于悬停

Html 角度模板变量仅适用于悬停,html,css,angularjs,restangular,angular-resource,Html,Css,Angularjs,Restangular,Angular Resource,在我的模板中,我有以下内容: <small class="badge"> {{reservationsCount}} </small> 为什么会这样?必须有更好的解决办法 更新:这也不起作用 <small class="badge" ng-bind-template="{{reservationsCount}}"></small> 你能在JSFIDLE上复制吗?你有PRUNKR吗?根据提供的信息无法判断。我如何在plunk或fiddle

在我的模板中,我有以下内容:

<small class="badge">
    {{reservationsCount}}
</small>
为什么会这样?必须有更好的解决办法

更新:这也不起作用

<small class="badge" ng-bind-template="{{reservationsCount}}"></small>

你能在JSFIDLE上复制吗?你有PRUNKR吗?根据提供的信息无法判断。我如何在plunk或fiddle中模拟来自API的响应?@couzzi在Plunker中,您可以添加一些JSON文件,并作为API调用向其发出请求。例如,添加
api/test.json
,然后在代码中您可以执行
$http.get('api/test.json')
——它看起来像api。如果您添加JS代码说明如何获得保留计数,我可能可以提供更多帮助。
<small class="badge" ng-bind-template="{{reservationsCount}}"></small>
<small class="badge" ng-bind-template="foo {{reservationsCount}}"></small>
$scope.reservations = reservations.get({
    future: '1'
}).then(function (res) {
   $scope.reservations = res;
   $scope.reservationsCount = res.count;
});