Class constructor DefaultEditor cannot be invoked without 'new'
See original GitHub issueI’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: '<i class="nb-plus"></i>',
createButtonContent: '<i class="nb-checkmark"></i>',
cancelButtonContent: '<i class="nb-close"></i>',
confirmCreate: true
},
edit: {
editButtonContent: '<i class="nb-edit"></i>',
saveButtonContent: '<i class="nb-checkmark "></i>',
cancelButtonContent: '<i class="nb-close"></i>',
confirmSave: true
},
delete: {
deleteButtonContent: '<i class="nb-trash"></i>',
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 Analytics
- State:
- Created 5 years ago
- Comments:6
Top Results From Across the Web
Class constructor cannot be invoked without 'new' in JS
The "Class constructor cannot be invoked without 'new'" error occurs for 2 reasons: Trying to instantiate a class without using the new operator....
Read more >angular - class constructor cannot be invoked without 'new
I am trying to use a 3rd party typescript library(antlr - https://github.com/tunnelvisionlabs/antlr4ts) in my angular 2 project created using ...
Read more >Javascript ES6 TypeError Class constructor Client cannot be ...
When I try to execute nodemon command I always see this error TypeError: Class constructor Client cannot be invoked without 'new'.
Read more >ckeditor/ckeditor5 - Gitter
Unhandled Promise rejection: Class constructor Plugin cannot be invoked without 'new' ; Zone: <root> ; Task: Promise.then ; Value: TypeError: Class ...
Read more >Angular script compilation: TypeError: Class constructor ...
TypeError : Class constructor MyScript cannot be invoked without 'new' at requireScriptForNodes (tools.ts:71) at attachScripts (tools.ts:220) ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hello,
I’m having the same problem when trying to upgrade to Angular 6.
My classes looks like this :
When I navigate to a page, and execute this code :
this.source = new ApplicationDatasource(params1, params2);
My console show the folllowing output :
Changing the compilerOptions is not applicable to my case either, so is there any way to solve this ?
Hey,
Infortunately no. And I haven’t had time to dig further into this, because I was swamped by work.
I’ll try to investigate this issue when I have some free time.