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 SinghRank #66 · 26.2K reputationPosted Aug 29, 2021, 11:53 PM EDT
Sachin SinghRank #66 · 26.2K reputationPosted Aug 30, 2021, 12:32 AM EDT
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).
Pranam BhatRank #500 · 4.9K reputationPosted Aug 30, 2021, 1:13 AM EDT
Sachin SinghRank #66 · 26.2K reputationPosted Aug 30, 2021, 1:26 AM EDT
Md SarfarajRank #194 · 12.4K reputationPosted Aug 29, 2021, 11:33 PM EDT