Giter Site home page Giter Site logo

Comments (13)

mariotaku avatar mariotaku commented on May 12, 2024 7

For people who still have this issue, do a force app load if failed:

win.webContents.on('did-fail-load', () => win.loadURL(...));

from angular-electron.

CPrescher avatar CPrescher commented on May 12, 2024 4

The change to <base href=''> actually breaks reloading right now for routing without useHash=true.

It adds to every URL an extra backslash which cannot be resolved by the router e.g. it goes from "file" to "file/" which is quite annoying and it is hard to find out why this is happening.

I checked with electron and the reload seems to work for hashing and without it with the
<base href='/'> at least for angular 9

Since the latest version of this repo is supporting angular 9, would it be possible to change the base element back, since there is no need for the href='' anymore and it only will provide confusion for future users who also do not want to use hashing.

from angular-electron.

michaelb-01 avatar michaelb-01 commented on May 12, 2024 2

I think I’m having the same issue, is this the only solution? It would be nice to be able to configure electron to work with html5 location strategy (angular’s default)

from angular-electron.

shivarajnaidu avatar shivarajnaidu commented on May 12, 2024 1

Yes... Is there any other solution for this to make things work with angular's default strategy

from angular-electron.

maximegris avatar maximegris commented on May 12, 2024 1

@CPrescher You are right. The base-href should be declared with / in order to use both routing strategies (with or without fragments) with hot reload.

By the way routing doesn't seems to work when the app is encapsulate in an electron executable when base-href is set to / (after running electron:local or electron:linux or electron:windows or electron:mac).

To make it works, I had to set --base-href ./ in npm build script.

I also added another page module to check that the routing is correctly working.

from angular-electron.

rbalet avatar rbalet commented on May 12, 2024 1

For people who still have this issue, do a force app load if failed:

win.webContents.on('did-fail-load', () => win.loadURL(...));

This will work, but you will loose the value of the variable because your app will be restarting. So if you need a log-in screen before you're able to run the electron app, be sure to store the value in the localStorage or somewhere else

@maximegris
Adding the --base-href ./ make my app loose the location to the assets folder. did you had the same problem ? If yes could you find a fix?

from angular-electron.

maximegris avatar maximegris commented on May 12, 2024

Thanks for this report !
I pushed the fix.

Regards

from angular-electron.

jddeltoro avatar jddeltoro commented on May 12, 2024

Had the same issue working with electron & angular 7, this solved for me.

from angular-electron.

Shaimae18 avatar Shaimae18 commented on May 12, 2024

2019 still working dude
Ng8

from angular-electron.

CPrescher avatar CPrescher commented on May 12, 2024

Great, thank you for making this change so fast.

from angular-electron.

maximegris avatar maximegris commented on May 12, 2024

You're welcome :)

from angular-electron.

seiyria avatar seiyria commented on May 12, 2024

Is webpack supposed to reload the renderer when you change angular-related code? I'm not seeing webpack attempt to recompile anything when I change an html file.

from angular-electron.

petef19 avatar petef19 commented on May 12, 2024

Also cannot get this to work. my stack:

@ionic/[email protected]
@ionic-native/[email protected]
@capacitor/[email protected]
[email protected]
[email protected]

Had to employ the {useHash: true} option as well as set to get manual reload working via ctrl+R. electron-reload itself never works on this stack.

If I add it top of Electron's index.js file (Capacitor renamed main.js to index.js) as per the example on the main page of this repo, then on every detected change the cursor starts flickering and an endless spinning circle appears next to the cursor until I close the Electron window...

any idea how to fix this ? would love to have auto-reloads in Electron browser...

from angular-electron.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.