import { Component } from '@angular/core';
import { CustomEditorComponent } from './custom-editor.component';
import { CustomRenderComponent } from './custom-render.component';
@Component({
selector: 'advanced-example-custom-editor',
template: `
`,
})
export class AdvancedExamplesCustomEditorComponent {
data = [
{
id: 1,
name: 'Leanne Graham',
username: 'Bret',
link: 'Google',
},
{
id: 2,
name: 'Ervin Howell',
username: 'Antonette',
link: 'Ng2 Admin',
},
{
id: 3,
name: 'Clementine Bauch',
username: 'Samantha',
link: 'Ng2 smart table',
},
{
id: 4,
name: 'Patricia Lebsack',
username: 'Karianne',
link: 'Blur Admin',
},
];
settings = {
columns: {
id: {
title: 'ID',
},
name: {
title: 'Full Name',
type: 'custom',
renderComponent: CustomRenderComponent,
},
username: {
title: 'User Name',
},
link: {
title: 'Link',
type: 'html',
editor: {
type: 'custom',
component: CustomEditorComponent,
},
},
},
};
}