Closed shidandev closed 1 year ago
i found solution, use this reference, ~but python eel can't invoke function from js eel, from my understanding, python init -> my directory and start without detecting eel.expose in every component in angular, except eel.expose in index.html~
workaround for python pass data to angular: https://github.com/python-eel/Eel/issues/655#issuecomment-1554179655
Very good, I report here briefly the solutions reported in the references in case they are no longer available in the future:
app-routing.module.ts
use this: RouterModule.forRoot(routes, { useHash: true })
)You should can close issue now.
Update for Angular, python eel can invoke simple function put on index.html
step 1. app.component.ts,
window["dummy"] = new Subject
step 2. index.html
eel.expose(sendData); function sendData(data){ if(data){ window["dummy"].next(data); //<== window["dummy"] created as Subject Instance from rxjs } }
!!! make sure key "dummy" created on window object as Subject Instance...
then on python, just call function declare on index.html....
eel.sendData({"msg":"something from python"})
try to make angular service listen to window["dummy"] based on your system requirement.... or make it dynamic...
Can you help how to overcome virtual route for angular compatible with eel after refresh, hosting i use .htaccess but in this i have no clue to proceed