When creating a dynamic standalone component at runtime the HTML renders in the ViewContainerRef but angular materials does not work with the exception of MatIcon. Please see the example of code
const compMetadata = new Component({
standalone: true,
selector: selector,
imports:[NgIf,NgForOf, NgSwitch,AsyncPipe ,MatIconModule,MatButtonModule,DynamicComponentLoader],
schemas: [ CUSTOM_ELEMENTS_SCHEMA ],
template: component.rawHTML,
styles: component.rawCss,
});
const dynamicComponent = await Component(compMetadata)(class DynamoComponentBuild {
showme = true
});
// console.log('ClassName',className,selector,compMetadata);
const ref = this.dcc.createComponent(dynamicComponent as Type<unknown>);
I have attempted to add the 'CommonModule' in the imports with no avail. Any suggestions or help would be greatly appreciated.