chevron_left
211 points
11 3 3

Define Topics of Angular

Topics of Angular :

  1. Module file
  2. Components
  3. Routing
  4. Services
  5. Data Binding
  6. Event Binding
  7. Templates
  8. Directives
  9. Uses of RxJs

Today We will define some topics of Angular 6.

Module File in Angular:

After the start, the project through ng serve command then app.module.ts  automatically created . The .ts represent a typescript file.

Handle section through this file(using ngmodule) :

  • Header
  • Center
  • Left
  • Right

It May look like the below;

 import { NgModule } from '@angular/core';
 import { BrowserModule } from '@angular/platform-browser';

 import { AppComponent } from './app.component';

 import { BsDatepickerModule } from 'ngx-bootstrap/datepicker';
 import { BsDropdownModule } from 'ngx-bootstrap/dropdown';
 @NgModule({
  declarations: [
    AppComponent
  ],
  imports: [
    BrowserModule,
    BsDatepickerModule.forRoot(),
    BsDropdownModule.forRoot()
  ],
  providers: [],
  bootstrap: [AppComponent]
 })
 export class AppModule { }

Angular 6 Components:

Most of the very important file components because the project all base on this file. In component most common .html 

who display on browser.

Component structure:

  • component.html
  • component.css
  • component.ts
  • component.spec.ts
  • module.ts

Angular 6 Services:

If you fetching the public API of the user list then user components will work. Angular services very important part, using this file you can easily code reusable.

How to generate Angular services:

  • Open CLI then enter the command
 >ng generate service kodlogs

After generation, you will see kodlogs.service.ts

 import { Injectable } from '@angular/core';

 @Injectable({
  providedIn: 'root'
 })
 export class DataService {

 constructor() { }
 }

If you can import more methods then add an upper line.

More Posts

Difference Between React and Angular. A Comparison Guide for 2021 KatarinaHarbuzava - Aug 11
Angular 6 interview question and answers for experienced usmanhashmi - Aug 3
Angular 6- Learn Angular 6 in my Three Article usmanhashmi - Jul 31
Angular 6 Interview Questions Lalit Kumar - Nov 30, 2020
Can't bind to 'ngif' since it isn't a known property of 'div'. john_dev - 4 days
"Export 'ɵɵdefineinjectable' was not found in '@angular/core'. john_dev - 4 days
Last Article Angular 6 usmanhashmi - Aug 1
2nd Article on Angular 6 usmanhashmi - Aug 1
Switching cases with NgSwitch in Angular Tomas Herman - Jul 30
Hosting a directive without a DOM element in Angular Tomas Herman - Jul 30