I need to execute some jquery in directive, im new in angular and i don`t know how to do this.
var temp = "<div class='cell' style='width:{width}px; height: {height}px; background-image: url(i/photo/{index}.jpg)'></div>";
var w = 1, html = '', limitItem = 49;
for (var i = 0; i < limitItem; ++i) {
w = 200 + 200 * Math.random() << 0;
html += temp.replace(/\{height\}/g, 200).replace(/\{width\}/g, w).replace("{index}", i + 1);
}
$("#freewall").html(html);
var wall = new Freewall("#freewall");
wall.reset({
selector: '.cell',
animate: true,
cellW: 20,
cellH: 200,
onResize: function() {
wall.fitWidth();
}
});
wall.fitWidth();
// for scroll bar appear;
$(window).trigger("resize");
}
this is the query you can check this in https://github.com/kombai/freewall, i need to execute it in angular directive or if you know some more efficiency way, u can share it here