【发布时间】:2016-12-26 16:31:27
【问题描述】:
对这个问题的跟进:AngularJS data bind in ng-bind-html?
如果我要插入的值附加到 ng-repeat 创建的范围怎么办?
myDict = {'Suggestion' : $interpolate('Vote here if you think {{player.name}} is right!')($scope)
...};// $scope is wrongly passed here as 'player' is not a scope variable,
然后
<div ng-repeat="player in players">
<span ng-bind-html="myDict['Suggestion']"></span>
</div>
是否可以在没有自定义指令的情况下做这样的事情?
【问题讨论】:
标签: angularjs angularjs-directive angularjs-ng-repeat ng-bind-html angularjs-interpolate