I am trying to add components created with ComponentFactoryResolver to a list. The reason is that I want to create the component based on schemas for the data I am presenting, so I will have multiple different components for different data types.
// get a reference to the list compontent in my view
const viewContainerRef = this.list.viewContainerRef;
this.list.clear();
// create a string editor and add it to the list
// this part will be replaced by a loop over all properties in my object
// and displaying an editor based on the editor data type
const componentRef = this.list.createComponent(componentFactory);
const component = (<StringEditorComponent>componentRef.instance);
component.configure({
name: 'editor 1',
readonly: false
}, 'value 1')
On the components I add ion-item attribute to the component (as they are supposed to be used inside a list) but they render very wrong. Is there something I can do to let ionic know that these components should be treated as ion-items?
Here is a plunker to demonstrate my problems: