Bootstrapping versus root component
You might ask why we need a bootstrap file to load the root component? Couldn't we have the root component in charge of loading everything itself? The answer is yes, we could. But, the good thing about having a bootstrap is better isolation, and as a result, better separation of concerns. Look at all those JavaScript files included in the index.html
and compare it to the contents of app.html
:
# index.html <!DOCTYPE html> <html> <head> <!-- head contents --> </head> <body> <app> Loading... </app> <script src="polyfills.bundle.js"></script> <script src="vendor.bundle.js"></script> <script src="app.bundle.js"></script> </body> </html> # app/app.html <h1>The Sherlock Project</h1>
Having a bootstrap in a project gives us more flexibility on the environmental and the browser settings and leaves the...