nav-bar.component.ts 570 Bytes
import { Component, OnInit } from '@angular/core';
import { Observable, interval } from 'rxjs';
import { switchMap, take } from 'rxjs/operators';

@Component({
	selector: 'nav-bar',
	templateUrl: './nav-bar.component.html',
	styleUrls: ['./nav-bar.component.css']
})
export class NavBarComponent implements OnInit {

	search : string = '';
	suggestion : boolean = false;

	constructor() { }

	ngOnInit(): void {
	}

	showinput() {
		interval(1000).pipe( take(1) )
			.subscribe(
				() => this.suggestion = true
			);
	}

	hideinput() {
		this.suggestion = false;
	}

}