You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
30 lines
882 B
30 lines
882 B
import { Component, OnInit } from '@angular/core';
|
|
import { Observable } from 'rxjs';
|
|
import { ProductService } from 'src/app/services/product.service';
|
|
import { Product } from 'src/app/models/product';
|
|
import { Router } from '@angular/router';
|
|
|
|
@Component({
|
|
selector: 'app-page-nav-bar',
|
|
templateUrl: './page-nav-bar.component.html',
|
|
styleUrls: ['./page-nav-bar.component.css']
|
|
})
|
|
export class PageNavBarComponent implements OnInit {
|
|
|
|
searchValue: string = "";
|
|
products : Observable<Product[]>
|
|
|
|
constructor(private _productService : ProductService, private router: Router) { }
|
|
|
|
clickme() {
|
|
alert('searchValue: '+this.searchValue);
|
|
this.products = this._productService.searchProduct(this.searchValue);
|
|
this._productService.search = this.searchValue;
|
|
// this.router.navigate(["/search", {search: this.searchValue}]);
|
|
|
|
}
|
|
|
|
ngOnInit(): void {
|
|
}
|
|
|
|
}
|