Import Electron in a Angular 2 project with Typescript and SystemJS


#1

Hi guys,

I have created a project with the angular2 cli. In my main.ts I would to import electron like that:

import { electron } from 'electron'

This is not working. I have checked and usually we import using electron using require. Angular 2 using SystemJS I would like to import electron that way.

Can someone explain me why this is not working and how can I get through this?

Thanks :slight_smile:


#2

I have the same question.


#3

Could someone find the solution?


#4

Hi all.

I’m currently using electron-forge thats gives a template for angular2

npm install -g electron-forge
# Initialize a new project
$ electron-forge init my-new-project --template=angular2
# Launch your app
$ cd my-new-project
$ electron-forge start

It seems to work ok. It don’t use cli but I don’t know if it’s neccesary.


#5

Hi
Here Angular Typescript Electron with systemjs solution: https://github.com/Longfld/electron-angular-material