Prettied, Linted and updated angular.json according to the latest schematic of Angular CLI.
Now all that is needed is to make it ready for strict compiling. Removed eslint-plugin-prettier as it is not recommended and causes errors for both eslint and prettier Bumped to v8.0.0
This commit is contained in:
@@ -1,12 +1,13 @@
|
||||
import { Component, Inject, OnInit } from '@angular/core';
|
||||
import { FormBuilder, FormGroup } from '@angular/forms';
|
||||
import { MatAutocompleteSelectedEvent } from '@angular/material/autocomplete';
|
||||
import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog';
|
||||
import { FormBuilder, FormGroup } from '@angular/forms';
|
||||
import { debounceTime, distinctUntilChanged, map, startWith, switchMap } from 'rxjs/operators';
|
||||
import { Observable, of as observableOf } from 'rxjs';
|
||||
import { MathService } from '../shared/math.service';
|
||||
import { Batch } from '../core/voucher';
|
||||
import { Observable } from 'rxjs';
|
||||
import { debounceTime, distinctUntilChanged, startWith, switchMap } from 'rxjs/operators';
|
||||
|
||||
import { Batch } from '../core/batch';
|
||||
import { BatchService } from '../core/batch.service';
|
||||
import { MathService } from '../shared/math.service';
|
||||
|
||||
@Component({
|
||||
selector: 'app-issue-dialog',
|
||||
@@ -47,17 +48,14 @@ export class IssueDialogComponent implements OnInit {
|
||||
listenToBatchAutocompleteChange(): void {
|
||||
const control = this.form.get('batch');
|
||||
this.batches = control.valueChanges.pipe(
|
||||
startWith(null),
|
||||
map((x) => (x !== null && x.length >= 1 ? x : null)),
|
||||
startWith(''),
|
||||
debounceTime(150),
|
||||
distinctUntilChanged(),
|
||||
switchMap((x) =>
|
||||
x === null ? observableOf([]) : this.batchSer.autocomplete(this.data.date, x),
|
||||
),
|
||||
switchMap((x) => this.batchSer.autocomplete(this.data.date, x)),
|
||||
);
|
||||
}
|
||||
|
||||
displayBatchName(batch?: Batch): string | undefined {
|
||||
displayFn(batch?: Batch): string | undefined {
|
||||
return batch ? batch.name : undefined;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user