Sign up ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free.

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?

share|improve this question
    
What does Categories.get() return? Are you using ngResource or is that a custom service? –  satchmorun Feb 18 '13 at 18:16
    
Categories is a service living in the $rootscope, it returns an array, not a promise. I dont remeber why ... maybe I couldn't make it work with promises. –  olanod Feb 18 '13 at 19:00
    
What's your question? –  Stewie Feb 25 '13 at 17:58
    
How to make the columnize directive? –  olanod Feb 25 '13 at 22:40

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.