can anyone give me a clear idea, that which runs first, Index.html or main.ts?
If Index.html runs first.
point 1. Main.ts or better say Main.js (after transpilation) can't run by itself as it is a javascript file at the end, and Index.html file is the one that contains the main.js at the bottom before the closing body tag, obviously the webpack does all this.
Now, let's say from the configuration that is Angular.json file, the angular knows that Index is the main HTML file that should be served first.
Then again, as Main.js is unknown at this point, so there is no way that the angular would know about the root component. And it must throw an error while parsing
first way:- Angular.json ---> Main.js--->Index.html (but how is this possible? who triggers Main.js?)
second way:- Angular.json--->Index.html---->Main.js (but then how do angular know about

Sachin SinghPosted Aug 30, 2021, 5:26 AM
Pranam BhatPosted Aug 30, 2021, 5:13 AM
Sachin SinghPosted Aug 30, 2021, 4:32 AM
I can't confirm it
but I am 99.9 % sure that index.html runs first with empty app-root at the beginning and then as soon as the flow reaches the Main.js , it loads the template (html).
Sachin SinghPosted Aug 30, 2021, 3:53 AM
Md SarfarajPosted Aug 30, 2021, 3:33 AM