2

We have huge enterprise application written in angularjs.

Now we have to migrate to angular, so we have ruled out an option of hybrid approach angular suggests using "ngUpgrade".

So now we are creating a new application in angular, which means we have 2 applications "angularjs(old)" and angular(new).

So to switch between these two applications can be done without refresh using angular-spa.

I was trying to find if there is another framework, where navigating between two apps happens without refreshing(without refreshing entire page by navigating to new html).

Milo
  • 3,365
  • 9
  • 30
  • 44
sandeep
  • 2,862
  • 9
  • 44
  • 54
  • 1
    If you want to do that, you have to append both of your applications in the same `index.html` file, otherwise your page will be reloaded due to URL change. –  Jun 06 '19 at 06:41
  • will there be framework conflicts between frameworks(angular and angularjs). Do we have any framework that help in doing this?? – sandeep Jun 06 '19 at 07:26
  • 1
    I don't think so, both frameworks have their own context and syntax you should be good. The only conflicts that may happen is if they both manipulate the same parts of the DOM (which, obviously, you should avoid) –  Jun 06 '19 at 08:33

2 Answers2

3

Possible solution: Use a new Angular application as a wrapper, then just use iframe to show the application you want depends on the context - old or new. The issue you might face is changing the iframe, but I guess you can use postMessage to communicate between the apps.

A bit more sophisticated: Use Angular Elements to create your hybrid app. I really recommend you to watch Erin talks from the last Angular connect about how Google made the migration from js to Angular.

Eliran Eliassy
  • 1,590
  • 12
  • 25
  • Thanks for the quick response. Angular Elements are not supported in edge and IE if i am not wrong – sandeep Jun 06 '19 at 08:43
0

I've recently tried the micro-frontend architecture described here: https://www.martinfowler.com/articles/micro-frontends.html

Each app on different code repository, runtime build and quite easy to implement. Take a look :)

AdamKniec
  • 1,607
  • 9
  • 25