angularjs - How do I move divs around? -
i have list of elements in html, this:
<div>information div</div> <div>div 1</div> <div>div 2</div> <div>div 3</div>
what need move information div
around dom, appears after whichever div user clicks on. so, if user clicks on div 1
, new dom like:
<div>div 1</div> <div>information div</div> <div>div 2</div> <div>div 3</div>
this pretty easy jquery, gather direct dom manipulation frowned upon in angular. there way of doing angularjs?
to add additional twist, information div
should appear above final div, if user clicked div 2
*or div 3
, dom like:
<div>div 1</div> <div>div 2</div> <div>information div</div> <div>div 3</div>
you have content in ng-repeat. add orderby filter repeat sorts in order specify. add click event change sort order based on rules defined above.
Comments
Post a Comment