In Angular, if I want to add a DOM element called elem1
dynamically and want to run some method to make elem1
for example draggable, how can I determine that the DOM element is ready for use? Because if I run the draggable
method instantly after the DOM element adding function, it may doesn't work some times.
I tried OnChanges
in ng but it seems this only works for @Input
rather than DOM.
So I am now using jQuery.ready() function but I wonder if there is more elegant way in Angular.