Y
Y
Yuri2016-06-10 11:04:26
Angular
Yuri, 2016-06-10 11:04:26

How to swap content between two divs in angular?

<a href="#">change content</a>
<div id="div_1"></div>
<div id="div_2">
 <!-- content -->
</div>

There is a div with id="div_1" and content inside. It is necessary to move the content to the div with id="div_2" on click on the link and then back. How to implement this in angularjs? Tell me please. Thank you.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Alex, 2016-06-10
@modestguy

The value of the model of the first div into a variable, and the value of the model of the second div into the model of the first. then from the variable to the model of the second div.

Y
Yuri, 2016-06-10
@modestguy

Well, I was interested in general principles. Maybe there is some tricky way that, with sufficient knowledge of angular, is recognized. Thanks to all. If you have any other thoughts please share.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question