Im trying to use a custom Renderer component in my ng2-smart-table but am getting the following error.
No component factory found for undefined. Did you add it to @NgModule.entryComponents?
at…, …}
Whats Strange is that the component says its undefined.
My component looks like this.
import { Component, OnInit, Input } from '@angular/core';
import { ChannelTableModeService } from '../../../../../../services/channel-table-mode.service';
import { ViewCell } from 'ng2-smart-table';
@Component({
selector: 'app-channel-attribute-renderer',
template: '{{renderValue}} --'
})
export class ChannelAttributeRendererComponent implements OnInit {
constructor() { }
renderValue: string;
@Input() value: string | number;
@Input() rowData: any;
ngOnInit() {
this.renderValue = '<' + this.value + '>';
}
}
I've also made sure that the component is in the module.
@NgModule({
imports: [
Ng2SmartTableModule,
CommonModule,
ChannelProfileRoutingModule,
VeexCommonModule,
TranslateModule,
FormsModule
],
entryComponents: [ChannelAttributeRendererComponent, PasswordRenderComponent],
providers: [ChannelTableModeService],
declarations: [ PasswordRenderComponent, ChannelProfileComponent, ChannelTableComponent, ServiceTypeComponent, ServiceGroupComponent, ChannelPlanEditorComponent, ChannelAttributeRendererComponent]
})
export class ChannelProfileModule { }
So does anyone see the issue. Why does he factory think that the component is undefined.
The configuration form my smart table looks like this:
this.settings = {
columns: {
'Channel': {title: 'Channel'},
'Channel Label': {title: 'Channel Name'},
'Video': {title: 'Video', type: 'custom', renderComponent:
PasswordRenderComponent}
}}
Try getting the distribution code of ng2-smart-table from github and replace your existing ng-smart-table code in node_modules directory.
I had too had a similar issue, I fixed it by replacing the ng-smart-table module from distribution