0

We are trying to integrate a JEE app (jsp on the frontend) with an angularJs app. The angularJS is being packaged with webpack so in the jsp we are linking the app thru a <script> tag

The application is being manually bootstrapped once the modules are already defined.

The result once the manual bootstrapping occurs is kind of an infinite loop between the jsp and the angular app. We can see the url alternating between these two:

http://localhost:8080/app/initApplication?lang=ES&TOTAL_APPROVALS=1#_
http://localhost:8080/app/initApplication?lang=ES&TOTAL_APPROVALS=1#/

Note the / at the end of the second one.

The angular app sometimes get rendered in the browser and some others don't.

We think it has something to do with what occurs with $location when manually bootstrapping an Angular app but we really don't know.

What's going on?

juanpavergara
  • 1,511
  • 1
  • 11
  • 22
  • Did you get ahead with this? By your description it sounds like you could have some kind of a race condition there (sometimes works, sometimes doesn't). You can try to simplify the Angular code to absolute minimum. Maybe that will pinpoint the issue. – Juho Vepsäläinen Apr 27 '15 at 06:14
  • @bebraw we did reduce the code to the minimum and it still happened. In the end it worked thanks to a refactor. We changed the code to make our own directive and a manual bootstrap. I'd still love to know what's going on with the first implementation. – juanpavergara Apr 28 '15 at 13:26
  • Great to hear you managed to resolve it. I haven't worked enough with the combination you are using so it's hard to say what caused the behavior in the end. When bootstrapping manually, you you should trigger it only after the document is ready. That's one possible explanation perhaps. – Juho Vepsäläinen Apr 28 '15 at 13:31

0 Answers0