Angular: New component
Components can be created from cli by running ng generate component servers
or ng g c servers
where servers
is name of component.
Here we will describe how to it manually.
Component is basicaly a typescript class. We will create new component called server
.
Create src/app/server/server.component.ts
import
will import component decorator
@Component
is decorator - typescript feature which will enhance our class
selector
is selector by which we will identify it and use in other component templates (html files)
Create src/app/server/server.component.html
In src/app/app.module.ts
In src/app/app.component.html