1
我在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"]
}
太貴了,不是嗎? – Cherniv
也許,但他問的是如何替換列表,而不是將一個附加到另一個。 – Rob
角度是驚人的! – rupert