1

如何替换以下代码中的{{eachTab.tabName}}with ?ng-bind

<tabset>
    <tab ng-repeat="eachTab in rowTabs" heading="{{eachTab.tabName}}"
         select="createRecsforeachTab(dSet, eachTab)">
    </tab>
</tabset>
4

2 回答 2

0

尝试将 ng-repeat 移动到 tabset 范围,如下所示:

<tabset ng-repeat="eachTab in rowTabs">
    <tab heading="{{eachTab.tabName}}" ng-bind-html="{{eachTab.tabName}}" select="createRecsforeachTab(dSet, eachTab)"> </tab>
</tabset>
于 2015-05-12T11:59:26.787 回答
0

你已经回答了!绑定

以下代码来自@badsyntax的这篇文章

angular.module("template/tabs/tab.html").run(["$templateCache", function($templateCache) {
  $templateCache.put("template/tabs/tab.html",
    "<li ng-class=\"{active: active, disabled: disabled}\">\n" +
    "  <a ng-click=\"select()\" tab-heading-transclude ng-bind-html=\"heading\"></a>\n" +
    "</li>\n" +
    "");
}]);
于 2015-05-12T11:59:55.177 回答