Class constructor DefaultEditor cannot be invoked without 'new'
- 主要言語
- TypeScript
- スター
- 1.6k
- フォーク
- 867
- PR マージ指標
- 30日以内にマージされた PR はありません
説明
**I'm submitting a ...** (check one with "x")
* [ ] bug report
* [ ] feature request
### Issue description
**Current behavior:**
I'm trying to implement a custom component for editing a property, but after i click the edit button i'm getting the following error:
```
zone.js:192 Uncaught TypeError: Class constructor DefaultEditor cannot be invoked without 'new'
at new ZoneNameEditorComponent (zone-name-editor.component.ts:17)
```
**Related code:**
This is my code to the custom editor:
```
import {
Component,
OnInit,
ViewChild,
ElementRef,
AfterViewInit
} from '@angular/core';
import { DefaultEditor, Cell } from 'ng2-smart-table';
@Component({
selector: 'zone-name-editor',
templateUrl: './zone-name-editor.component.html',
styleUrls: ['./zone-name-editor.component.scss']
})
export class ZoneNameEditorComponent extends DefaultEditor implements AfterViewInit {
constructor() {
super();
}
ngOnInit() {}
ngAfterViewInit(): void {}
}
```
this is my settings:
```
temp_curr_settings = {
hideHeader: true,
hideSubHeader: true,
actions: {
delete: false
},
add: {
addButtonContent: '',
createButtonContent: '',
cancelButtonContent: '',
confirmCreate: true
},
edit: {
editButtonContent: '',
saveButtonContent: '',
cancelButtonContent: '',
confirmSave: true
},
delete: {
deleteButtonContent: '',
confirmDelete: true
},
columns: {
name: {
title: 'Name',
type: 'string',
editor: {
type: 'custom',
component: ZoneNameEditorComponent,
},
}
}
```
### Other information:
**npm, node, OS, Browser**
```
Angular CLI: 6.0.7
Node: 8.11.3
OS: linux x64
Angular: 6.0.0
... animations, common, compiler, core, forms, http
... language-service, platform-browser, platform-browser-dynamic
... router
Package Version
-----------------------------------------------------------
@angular-devkit/architect 0.6.0
@angular-devkit/build-angular 0.6.0
@angular-devkit/build-optimizer 0.6.0
@angular-devkit/core 0.6.0
@angular-devkit/schematics 0.6.7
@angular/cdk 6.1.0
@angular/cli 6.0.7
@angular/compiler-cli 6.0.3
@ngtools/webpack 6.0.0
@schematics/angular 0.6.7
@schematics/update 0.6.7
rxjs 6.1.0
typescript 2.7.2
webpack 4.6.0
コントリビューションガイド
このリポジトリのコントリビューションガイドは索引されていません
評価
この issue はまだ評価されていません。