I'm writing some pretty complex DOM manipulations, which is sure to test my ability to write very complex directives. I have not come across any examples (I think anyway) that demonstrate what I'd like to do.
Let's say I have a list of widgets, which can be of different types. These widgets need to be displayed within an <ul>
element. Each type of widget can be different though, so the actual markup for each widget inside the <li>
will drastically be different.
If all I needed was standard markup, I don't think it would be that difficult to implement this, but each of these widgets will in turn have to create html fragments that I want Angular to process. They could be something simple like wanting to use ng-click
, but maybe something more complex like wanting to use my own custom directive too.
Ideally, I'd want to create directives for each of the widgets separately, just to separate concerns because I think the code for most of them will be quite complex in of themselves. Then, I'd probably want to have another directive check the type of the widget and create an html fragment that uses the individual widget directives. Does that make sense? If not, then I'd probably want to separate concerns in a similar way.
Is there a way to do this?