ANGULAR in less than 128 words – TypeScript – Angular Part 8

This article follows the first seven on the subject ANGULAR and deals with the language TypeScript:

Templates and interpolation

Interpolation is the incorporation of expressions into marked text. By default, interpolation uses double braces, 'and 'a' as a delimiter.

<h3>Customer Number: 'numbereroClient'</h3>

Example of a directive with iteration:

<li *ngfor="let client of listeClients">''</li>


The services allow to decouple the component of the call to a service, they are thus reusable.

ng generate customer service
import - Injectable - from '@angular/core';

  providedIn: 'root',
export class ClientService



The logic is then decoupled from the service which is injectable via the addiction injection.

Addiction injection

Example of injection of CustomerService dependency into a CustomerComponent component

import - Component, OnInit - from '@angular/core';

import 'Hero ' from '.. /hero';
import 'HeroService ' from '.. /hero.service';
import 'MessageService ' from '.. /message.service';

  selector: 'app-heroes',
  templateUrl: './heroes.component.html',
export class ClientComponent implements OnInit


  getClients(): void