Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does angular 2 AOT support multiple startup page?

I currently have an [email protected] app which uses [email protected] for build and dev work. In this setup i have two startup pages index.html and login.html so both of them have their own separate booststrap and modules.This setup works just fine.

But now i am trying to Add AOT to the mix, and i am not able to make both work.

For example if index.html works then login.html gives me error "Error: The selector "my-app" did not match any elements". and similarly if login.html works then index.html gives me error "Error: The selector "my-login" did not match any elements".

So before i dig further, can anyone tell me if this scenario (of multiple entry) is possible with AOT?

like image 312
surya Avatar asked Aug 22 '26 08:08

surya


1 Answers

I think the answer may be "no". Please see this from the docs:

"With AOT, the compiler runs once at build time using one set of libraries; With JIT it runs every time for every user at runtime using a different set of libraries."

AOT only running once may explain the issue you're having.

like image 56
Muirik Avatar answered Aug 24 '26 22:08

Muirik



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!