In Angular we typically load a component as a tag in the markup, perhaps assisted by some conditionals or for loops to make the loading more dynamic. Generally this is the recommended approach, but there are cases where you don't know the DOM structure at compile time. In these cases we need to be able to add components on demand in arbitrary locations. It might be tempting to fall back on jQuery for this, but Angular provides a ComponentFactoryResolver that we can use instead.
To demo this feature I have created a graph component where I am letting the user connect vertices with edges to form a graph. I am modeling the edges as separate components, but since the user can connect any pair of nodes, there is no way to know ahead of time where to put the edge components.
... read the whole story at www.syntaxsuccess.com.