Angularjs 如何在ng单击时刷新ng include

Angularjs 如何在ng单击时刷新ng include,angularjs,Angularjs,我想加载参数并将其传递给ng include 当用户单击一个按钮时,它希望用另一个参数重新加载相同的ng include 现在不行了。你知道怎么做吗 代码如下: html: <div ng-controller="ListCtrl"> <button class="btn" type="button" ng-click="loadList(A)">A</button> <button class="btn" type="button" n

我想加载参数并将其传递给ng include

当用户单击一个按钮时,它希望用另一个参数重新加载相同的ng include

现在不行了。你知道怎么做吗

代码如下:

html:

<div ng-controller="ListCtrl">
    <button class="btn" type="button" ng-click="loadList(A)">A</button>
    <button class="btn" type="button" ng-click="loadList(B)">B</button>
    <div ng-include="'tplList.html'" onload="loadList(0)"></div>
</div>

您就快到了,您需要像下面这样传递
A
B

<button class="btn" type="button" ng-click="loadList('A')">load list 1</button>
<button class="btn" type="button" ng-click="loadList('B')">load list 2</button>
加载列表1
负载列表2
<button class="btn" type="button" ng-click="loadList('A')">load list 1</button>
<button class="btn" type="button" ng-click="loadList('B')">load list 2</button>