I'm still new with AngularJS directives, now I'm trying to use columnize plugin but without success. This answer is a good start but won't solve my problem because Categories.get()
fetches data asynchronously from the server and setting a timeout doesn't seem the solution at all.
<div columnize>
<ul>
<li ng-repeat="data in Categories.get()">
<a ng-href="{{ data.uri }}">{{ data.name }}</a>
<ul>
<li ng-repeat="data in data.categories" ng-include="'list.html'"></li>
</ul>
</li>
</ul>
</div>
Edit: Categories service.
app.factory('Categories',function ($http) {
var categories = [],
URL = '/categories';
if (categories.length == 0) {
$http.get(URL).success(function (data) {
categories = data;
})
}
return {
get: function () {
return categories;
},
....
};
Based on the source of my data how should make the columnize directive with the columnize jQuery plugin?