私は 2 つの div を持っています。1 つは空で始まり、もう 1 つは定義済みの項目があります。一方のリストの項目をクリックすると、もう一方のリストに項目が追加されます。
私が達成したいのは、あるリストのアイテムをアニメーション化して、物理的に別のリストに移動するように見せることです。(アイテムを右から左に移動したい)。CSS アニメーションや AngularJS アニメーションについてはよくわかりません。jQuery では、div id で $().animate() を呼び出すだけでプロパティを変更できます。
AngularJS で同じことを行うにはどうすればよいでしょうか?
JS:
var app = angular.module('app', []);
app.controller('Ctrl', function ($scope) {
$scope.selectedItems = [];
$scope.items = ['a', 'b', 'c'];
});
HTML:
<div ng-controller="Ctrl">
<div class='container'>
<div class='inline selected-container' >
<div ng-repeat='selected in selectedItems track by $index'> <!-- I would like items to appear here after items from other container have finished moving -->
{{selected}}
</div>
</div>
<div class="inline">
<!-- I would like to push these items left on click -->
<div class='inline box' ng-repeat="item in items" ng-click="selectedItems.push(item);">
{{item}}
</div>
</div>
</div>
</div>
ここに私がこれまでに持っているものへのリンクがあります: