angularjs - How to add an angularui accordion-group dynamically -
in angularjs service, adding html accordion-group dom of accordion element. results display of accordion-group if panel - no title bar, no collapse behavior.
i'm sure because accordion gets initialized before content added. jqueryui accordion has refresh method such occasions, not sure how angualrui accordion recognize new accordion group.
hope following steps :
get reference of element want add accordion
html :
<div id = "myaccordion"> </div>
controller :
var parent = angular.element("#myaccordion");
compile accordion template , attach parent
controller:
var accordion = $compile("<div accordion> </div>")($scope); parent.append(accordion);
but work around should ideally have directive dom manipulation , perhaps coding jquery in mind.
Comments
Post a Comment