I have an existing Electron Angular app all running fine. I want to create a new window on a button click and have that window use a given Angular component for it's initial UI content.
So I make a new component like so:
ng generate component TrivialComponent
Now, in my electron app I make sure that at top of app.module.ts I have:
import { TrivialComponent } from './trivial.component';
and also that it is added to declarations like so:
@NgModule({
declarations: [
AppComponent,
TrivialComponent,
now, on my button click event I add:
var w = new BrowserWindow({
title: "My Title",
minWidth: 800,
minHeight: 600,
frame: true,
resizable: true,
transparent: false,
closable: true,
show: false,
webPreferences: {
nodeIntegration: true,
contextIsolation: false,
allowRunningInsecureContent: true,
enableRemoteModule: true
} as Electron.WebPreferences
});
w.show();
w.loadFile("dist/index2.html");
and the body of index2.html is:
<body class="igx-typography">
<app-trivial></app-trivial>
</body>
When I run this I get a new empty window, but content is blank rather then the html of my new component, which is:
<p>Trivial component works!</p>
Would anyone know what I am missing?