4.4 Angular Form - quan1997ap/angular-app-note GitHub Wiki

https://blog.angular-university.io/angular-form-array/

ngFor

  1. Với number: *ngFor="let x of [].constructor(5)"

#2. Angular search Form

      <form class="search-form" [formGroup]="searchForm">
        <mat-form-field class="cb-input input-with-underline" appearance="fill">
          <input matInput type="text" formControlName="textSearch" placeholder="Search">
          <mat-icon matSuffix svgIcon="cb_search" ></mat-icon>
        </mat-form-field>
      </form>

  import { debounceTime, distinctUntilChanged } from 'rxjs';
  constructor(
    private fb: FormBuilder
  ) { 
    // Search 
    this.searchForm = this.fb.group({ textSearch: '' });
    this.searchForm.controls['textSearch'].valueChanges
    .pipe(
        debounceTime(500),
        distinctUntilChanged()
    )
    .subscribe(textSearch => {
        console.log(textSearch)
    });
  }
⚠️ **GitHub.com Fallback** ⚠️