Photon icon indicating copy to clipboard operation
Photon copied to clipboard

How to use with Angular 9

Open ReedOwens opened this issue 4 years ago • 2 comments

I'm starting an Electron project using Angular 9 as the JS Engine. I've got other frameworks like Proton, and Xel (which uses web components) to work with Angular 9/Electron. I'm not sure how to get this cool package of yours to work.

For Web-Components there is a special change needed in the app.modules.ts file to add CUSTOM_SCHEMA to the schemas so that they are picked up. I've done this.

Your doc says to use

const Photon = require("electron-photon");

This doesn't work in Angular 9. It looks like an error trying to load the CSS.

Here is the console log: image

ReedOwens avatar Apr 07 '20 21:04 ReedOwens

Did you try import * as Photon from 'electron-photon' ? As far as I know, you can not use require to handle ES6 imports.

btxtiger avatar Apr 08 '20 00:04 btxtiger

Yes, I did that but none of the CSS is in the app. On the plus side, there are no errors in the log.

ReedOwens avatar Apr 08 '20 00:04 ReedOwens