When you create an Angular project, by default inside the folder src
has a file called index.html
. This file basically contains the structure you quoted, head
, body
and some other items. This file will be delivered every time your browser accesses your application.
Inside this file there is another important tag, usually called app-root
(can be changed) which is where Angular will create all the visuals and will manage (create DOM, add events, etc.) the entire application on the client side using Javascript.
So how will your application deliver a single file with the basic structure of an HTML page, for example to change the title
, you will have to resort to the functions that Angular has. To make this change to title
you will have to resort to class Title
in @angular/platform-browser
.
So you don’t have to worry so much about the head
and body
since they will be in a single file. My suggestion is to worry about how Angular works: https://angular.io/guide/architecture
I don’t know where you are learning and what level of learning you are at, but when you create an Angular project, the only HTML file that will have the tags
head
andbody
is the index.html inside the default foldersrc
. It basically serves to index the application in the browser, but for development purposes it is practically not used.– LeAndrade
Leandrade, when creating a new Component using the angular cli tool, a new file is automatically created. html, my doubt is, there is need to include these tags in these new files?
– Thomas Erich Pimentel
No need not
– LeAndrade