28
loading...
This website collects cookies to deliver better user experience
<html>, <head> and <body>
tags and so on right? These are native HTML elements that are provided to us. But what if we could create our own HTML elements?@NgModule({
declarations: [
AppComponent
],
imports: [
BrowserModule,
AppRoutingModule,
FormsModule,
CoreModule
],
providers: [],
bootstrap: [AppComponent]
})
export class AppModule { }
<app-root>
. This <app-root>
is the root component which encapsulates all the child components, i.e the components you create and bootstraps them to render everything inside it on index.html.<head>
<meta charset="utf-8">
<title>Demo Angular App</title>
<base href="/">
<meta name="viewport" content="width=device-width, initial-scale=1">
</head>
<body>
<app-root></app-root> //only this component will be present
</body>
</html>
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { AppComponent } from './app.component';
@NgModule({
declarations: [
AppComponent
],
imports: [
BrowserModule
],
providers: [],
bootstrap: [AppComponent]
})
export class AppModule { }