Karma unit testing error: Unexpected value imported by the module. Please add a @NgModule annotation

You are injecting MatDialogRef in component: constructor(private dialogRef: MatDialogRef<Mytest1Component>) { } So the testBed expects the same to be injected as provider to the TestBed. Or you can also provide a MockDialogueService to it. beforeEach(async(() => { TestBed.configureTestingModule({ declarations: [ Mytest1Component ], providers: [ MatDialogRef ], }) .compileComponents(); }));

Showing window after it is fully loaded

OK, I found an answer myself. The proper event is did-finish-load and should be used like this: var Window = new BrowserWindow({ width: 600, height: 400, show: false }); Window.loadUrl(‘file://somefile.html’); Window.webContents.on(‘did-finish-load’, function() { Window.show(); }); For people finding this answer – here you can check official electron documentation on this topic: While loading the page, … Read more

How to get folder path using electron

As @phuongle pointed out in the comments you want to use showOpenDialog(). Something like this: var remote = require(‘remote’); var dialog = remote.require(‘electron’).dialog; var path = dialog.showOpenDialog({ properties: [‘openDirectory’] }); UPDATE: If the above isn’t working for your current Electron version, you should try more modern importing: const {dialog} = require(‘electron’).remote; In addition, in order … Read more

ES6 syntax import Electron (require..)

It seems imports are not implemented in either Node 6 or Chrome 51 so Electron also does not support them, according to this post: https://discuss.atom.io/t/does-electron-support-es6/19366/18 And also the last electron doc doesn’t use imports, they use destructuring syntax: const { BrowserWindow } = require(‘electron’).remote // or const { remote } = require(‘electron’) const { BrowserWindow … Read more

tech