I want to use Angular ViewContainerRef createComponent method to dynamically create a component and add it to the view at a particular index (before or after). If I use viewContainerRef.createComponent and provide an index of 0, the component is added after any static DOM elements in the template.
In this example I would expect the component to be added before the "Template Div" element, but instead it is added after. Components added after that are added at the correct index, but never before the static DOM element.
https://stackblitz.com/edit/angular-dynamic-components-example-n6tae1?file=src/app/app.component.ts