javascriptjquery-pluginsangularjs-directiveangularjs-ng-repeatsinglepage

Jarvis.widget doesn't get rendered in AngularJS ng-repeat


I have a hard time figuring out what to do in my AngularJs single-page . I use ng-repeat to display a number of widgets. The plugin is "Jarvis widget v2.0". My problem is, that the article container does not have the functionality from the Jarvis widget (fullscreen, collapse etc.).

The data is delayed because of a HTTP GET call. If I hard-code the dataSeries it works 100%, but it seems that the Jarvis widgets gets rendered before the success of the HTTP GET. I have tried to find a solution for days and my guess is that a directive is the solution, but I'm lost!

<article class="col-xs-12 col-sm-12 col-md-6 col-lg-6" ng-repeat="chart in dataSeries">
       <div class="jarviswidget" id="wid-id-02" data-widget-editbutton="false" data-widget-colorbutton="false" data-widget-deletebutton="false"></div>
</article>

This is my first post, so if I forgot something i apologize in advance.


Solution

  • OK, with help from Darneas I came up with a solution.

    1. I implemented this: : Calling a function when ng-repeat has finished
    2. I made sure that "widget-grid" wasn't initialized (I had some test widgets)
    3. I called "setup_widgets_desktop()" from the ngRepeatFinished

    This was succesfull. Thank you Darneas. I wouldn't had found a solution otherwise.

    I couldn't get the widget directive to work, which looks like a great solution as well.