Use jQuery to make a NEW instance of angularJS array -
i working angular , jquery
i have div "a", pulling content via angular
<div class="a"> <p ng-repeat="banana in bananas">{{banana}}</p> </div>
i have ul class "b"
<ul class="b"> <li>content 1</li> <li>content 2</li> <li>content 3</li> <ul>
when of li
inside "b" clicked insert li
in .accordion
//this works fine $(".b li").click(function () { $(this).clone().appendto(".accordion"); });
the problem when want same thing div "a"... div "a" inserted on last appended li
jquery accordion div, empty,
<div class="accordion"> </div>
and trying create new instance of div "a" everytime li
clicked must inserted new child of accordion can work independently
class "a" must created within jquery, inserted
myvar = $("<div class="a"><p ng-repeat="banana in bananas">{{banana}}</p></div>"); $(".b li").click(function () { $(this).clone().append(myvar).appendto(".accordion"); });
Comments
Post a Comment