Last active
May 29, 2020 14:29
-
-
Save umutyerebakmaz/a56e0df10a1cb4291d0080f4f3dc8f07 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- activity.vehicleId --> | |
<mat-form-field appearance="outline" class="full-width"> | |
<mat-chip-list #vehicleList aria-label="Araç Seç"> | |
<mat-chip *ngFor="let vehicle of vehicles" [selectable]="selectable" [removable]="removable" | |
(removed)="removeVehicle(vehicle)"> | |
{{ vehicle.plate }} | |
<mat-icon matChipRemove *ngIf="removable">cancel</mat-icon> | |
</mat-chip> | |
<input placeholder="Araç Ekle..." #vehicleInput (keyup)="vehicleSearch()" [formControl]="vehicleCtrl" | |
[matAutocomplete]="vehicleAuto" [matChipInputFor]="vehicleList" | |
[matChipInputSeparatorKeyCodes]="separatorKeysCodes" [matChipInputAddOnBlur]="addOnBlur"> | |
</mat-chip-list> | |
<mat-autocomplete #vehicleAuto="matAutocomplete" (optionSelected)="selectedVehicle($event)"> | |
<mat-option *ngFor="let vehicle of vehicles$ | async" [value]="vehicle"> | |
{{ vehicle.plate }} | |
</mat-option> | |
</mat-autocomplete> | |
</mat-form-field> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
getVehicles() { | |
this.vehicles$ = this.vehiclesGQL | |
.watch({ plate: this.vehicleSearchKey, skip: this.skip, take: this.limit }) | |
.valueChanges.pipe(map(result => result.data.vehicles)); | |
} | |
// searches | |
vehicleSearch() { | |
this.vehicleSearchKey = this.vehicleCtrl.value || ''; | |
console.log(this.vehicleSearchKey); | |
this.getVehicles(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment