我在 HTML 中初始化了一个中继器 colorSetOne,然后,我想用另一个中继器 colorSetTwo 替换,如何做到这一点(它可以由事件触发)?这是jsfiddle:http: //jsfiddle.net/8xWRm/
HTML:
<ul ng-app ng-controller="cubeCtrl">
<li ng-repeat="color in colorSetOne">{{color}}</li>
Javascipt:
function cubeCtrl($scope){
$scope.colorSetOne = ["red","blue","green","oringe"]
$scope.colorSetTwo = ["blue","red","black","white"]
}