Return to site
ANGULAR INTERVIEW QUESTION: What is the role of the <base> tag in an Angular app?
ยท
Actually, in all Angular app, there is always a <๐๐๐ฌ๐> tag in the ๐ข๐ง๐๐๐ฑ.๐ก๐ญ๐ฆ๐ฅ file, in the project root folder:
Thig tag tells the Angular router how to build the URLs for the browsing,
by saying in which folder is the source code to do right the redirections.
If the folder which contains all your application is "๐๐ฉ๐ฉ" (which is the default folder by Angular CLI), you can just put the value <๐๐๐ฌ๐ ๐ก๐ซ๐๐="/">.
In conclusion, the <๐๐๐ฌ๐> tag enables the Angular router to build URLS related to the project "๐๐ฉ๐ฉ" folder.