My goal is to take Angular 2's 5 Minute Quickstart and turn it into an Electron app. Which I can do by adding "electron-prebuilt".
What I can't do is utilize any of Electron's extended captabilites - for example writing to the file system.
I can build and run "Electrogram", but when I try to utilize some of the basic functionality contained within it I get an error in the console of my Electron application:
Altered app.component.ts
import { Component } from '@angular/core';
import { remote, ipcRenderer } from 'electron';
import { writeFile } from 'fs';
@Component({
selector: 'my-app',
template: '<h1>My First Angular 2 App</h1><button (click)="doSomething()">Do Something</button>'
})
export class AppComponent {
doSomething() {
writeFile("c:\temp\doSomething.txt", "some data");
}
}
Error in DevTools Console
How can I configure the app to look for the Electron modules in their correct locations?