How to move an element from one div to another using angularjs -
i want move element 1 div div.
lets example there button in div-a , want move in div-b.
it can done in jquery like
$("div-b").append('button'); $("div-a button").remove();
but not able think start in angularjs 1x. there series of 10-20 divs in row , want move button 1 div sequentially.
in angular data represented objects
<div ng-repeat="a in ctrl.a"></div> <div ng-repeat="b in ctrl.b"></div> vm.a = ['a1', 'a2']; vm.b = []; function move(obj) { // find obj in vm.a , remove // push obj in vm.b }
then view should updated automatically.
Comments
Post a Comment