如何替换以下代码中的{{eachTab.tabName}}
with ?ng-bind
<tabset>
<tab ng-repeat="eachTab in rowTabs" heading="{{eachTab.tabName}}"
select="createRecsforeachTab(dSet, eachTab)">
</tab>
</tabset>
如何替换以下代码中的{{eachTab.tabName}}
with ?ng-bind
<tabset>
<tab ng-repeat="eachTab in rowTabs" heading="{{eachTab.tabName}}"
select="createRecsforeachTab(dSet, eachTab)">
</tab>
</tabset>
尝试将 ng-repeat 移动到 tabset 范围,如下所示:
<tabset ng-repeat="eachTab in rowTabs">
<tab heading="{{eachTab.tabName}}" ng-bind-html="{{eachTab.tabName}}" select="createRecsforeachTab(dSet, eachTab)"> </tab>
</tabset>
你已经回答了!绑定
以下代码来自@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" +
"");
}]);