Skip to content

Instantly share code, notes, and snippets.

@shilpasyal55
Last active July 7, 2019 15:49
Show Gist options
  • Save shilpasyal55/3b6d760588132e8a0b5b20f531539c79 to your computer and use it in GitHub Desktop.
Save shilpasyal55/3b6d760588132e8a0b5b20f531539c79 to your computer and use it in GitHub Desktop.
Autocomplete component html
<div class="card container">
<div class="label">
<label for="car">Search Car:</label>
</div>
<div>
<input id="car" #carSearchInput placeholder="Search Car By Name" class="form-control" type="text" autocomplete="off" (click)="showSearches = true">
</div>
<!-- DropDown Starts -->
<div class="card" [hidden]="!showSearches">
<div class="search">
<div *ngFor="let car of searchedCars; trackBy: trackById" tappable (click)="setCarName(car)" class="search-result">
{{car}}
</div>
</div>
<p class="search" *ngIf="searchedCars && searchedCars.length <= 0 && !isSearching">No Car found</p>
<p class="search" [hidden]="!isSearching">Searching cars...</p>
</div>
<!-- DropDown Ends -->
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment