28
loading...
This website collects cookies to deliver better user experience
Template and it is the view of the application is the HTML, it's what user seas on the browser like buttons, paragraphs, headings and so on.
Class is the code, logic associated with the view, it where we write the logic there
Properties or data Elements for use or bind in the view/HTML
Methods are functions that execute logic needed in the view
Selector : is useful when you are using the class inside the view
Template, is the view associated with the class
style is the CSS or sass related specifically to the view
create folder for your component in the app folder
create these files ComponentName.component.html, componentName.Component.ts, componentName.component.scss inside the folder
remember to replace component.Name => to appropriate name
and .scss file remember as we mentioned the other posts
inside the .ts file her we defined our class
import { Component, OnInit } from '@angular/core';
@Component({
selector: 'wc-community',
templateUrl: './community.component.html',
styleUrls: ['./community.component.scss']
})
export class CommunityComponent implements OnInit {
constructor() { }
ngOnInit(): void {
}
}
import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { AppComponent } from './app.component';
import {ComponentName } from './path of the component'
@NgModule({
declarations: [
AppComponent,ComponetnName
],
imports: [BrowserModule],
providers: [],
bootstrap: [AppComponent],
})
export class AppModule {}