3

Besides the added convenience, there is no reason for my landing page to be in an angular application with the added load performance overhead of loading the main bundle.

Is it possible to have a static landing page and lazy loading the rest of the angular app once the user clicks on any of the links that leave the landing page into the configured angular routes?

Reed
  • 1,305
  • 17
  • 32

1 Answers1

2

You can build a simple landing page pure in javascript whatever. If the user click on a special link, you will call your angular application. So you have an instance response for the user, after user interaction you can load your angular application

moohkooh
  • 887
  • 1
  • 10
  • 25
  • Would the landing page be built within angular and just not trigger the loads yet or would the angular app live in a different directory? – Reed Feb 01 '18 at 21:38
  • the angular-app should be in a different directory. Your landing page is a "simple" old school, html5, css3, javascript page. Of course, you can also build app an simple, small angular application as landing app, but you will have the angular stack overhead. If you really want to use a library on your landing page, check vue2. Its a small library (based on react) – moohkooh Feb 02 '18 at 14:17
  • @Reed did you ever figure this out? I am in the same predicament. I want to create an Angular app with a static html/js landing page such that I can easily change out the landing page to a/b test. I am also curious about your directory structure and how you deployed said app. – Reza Apr 21 '18 at 03:26
  • @Reza yes, I had to change the base href of the angular app to `./` and put the app in a directory that the landing page links to. https://stackoverflow.com/a/41308342/7896203 – Reed Apr 23 '18 at 19:42