Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <input type="search" class="form-control" placeholder="Search file" (keyup)="onSearch($) [(ngModel)]='searchKeywords'>
- onSearch(event: any) {
- const keywords = event.target.value;
- if (keywords && keywords.length > 2) {
- const apiURL =`abc/thg/hjy?filter[file.name]=${keywords}`;
- this.api.get(apiURL).subscribe((data: any) => {
- console.log(data);
- this.topics = data.list;
- if (this.trigger) {
- this.trigger.openMenu();
- }
- });
- } else {
- this.topics = [];
- this.trigger.closeMenu();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement