Hi Sander,

oh, I forgot that. Here's my template:

  <div class="dashboard-container">
    <dashboard-widget ng-repeat="(widgetKey, widget) in widgets" 
type="{{widgetKey}}"></dashboard-widget>
  </div>
(I assigned the 'widgets' var to the templates scope too, thats what the 
ng-repeat loops thru).

The tricky one was, to have the 'dashboard-widget' directive which prints 
out the container (e.g. title bar, close button, content area), and than 
place the widget content in it, dependent on the 'type' parameter. And the 
widget should be a directive too, so it can have seperate controller, view 
and scope.

Maybe there is an easier way ;)
My goal was having the ability to easy create new widgets - which can now 
be done.




Am Donnerstag, 12. Februar 2015 09:43:00 UTC+1 schrieb Sander Elias:
>
> Hi Jan,
>
> Just out of curiosity, how does your template look like? I don't get that.
> You are iterating over your widgets, that's easy enough, but then for each 
> widget you are iterating over all div's and and every widget to every div 
> that has .widget-content.
> I can't imagine how that turns out.
>
> Regards
> Sander
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.

Reply via email to