diff --git a/src/app/app.component.html b/src/app/app.component.html
index cc2f543..8f1b7f7 100644
--- a/src/app/app.component.html
+++ b/src/app/app.component.html
@@ -1,4 +1,4 @@
-
+
diff --git a/src/app/app.component.ts b/src/app/app.component.ts
index e8da6fd..7d379f0 100644
--- a/src/app/app.component.ts
+++ b/src/app/app.component.ts
@@ -1,5 +1,6 @@
import { Component } from '@angular/core';
import { NavigationEnd, Router } from '@angular/router';
+import { ApiBackService } from './services/api-back.service';
@Component({
selector: 'app-root',
@@ -9,8 +10,11 @@ import { NavigationEnd, Router } from '@angular/router';
export class AppComponent {
title = 'simpleat';
dontShow: boolean = false;
+ searchParam: any;
+ listResto: any;
- constructor(private router:Router){
+
+ constructor(private router:Router, private apiBackService : ApiBackService){
this.router.events.subscribe(e=>{
//console.log(e);
if(e instanceof NavigationEnd){
@@ -22,5 +26,30 @@ export class AppComponent {
}
}
})
+
+
+
+ this.searchParam = {
+ searchText : "",
+ filterText : "first"
}
+
+}
+
+ ngOnInit(): void {
+
+ this.listResto = this.apiBackService.getRestaurants();
+
+ console.log(this.listResto)
+ }
+
+ // onSearchResto(searchText: string,) {
+ // this.searchParam.searchText = searchText;
+ // const rawData = this.apiBackService.getRestaurants();
+
+ // this.listResto = rawData.filter(resto =>
+ // resto.name.toLowerCase().includes(searchText.toLowerCase()))
+ // }
+
+
}
diff --git a/src/app/header/components/search-bar/search-bar.component.html b/src/app/header/components/search-bar/search-bar.component.html
index fd6763f..48cb329 100644
--- a/src/app/header/components/search-bar/search-bar.component.html
+++ b/src/app/header/components/search-bar/search-bar.component.html
@@ -4,7 +4,8 @@
LE BON PLAN POUR MANGER
diff --git a/src/app/header/components/search-bar/search-bar.component.ts b/src/app/header/components/search-bar/search-bar.component.ts
index 5382ffc..0ada60f 100644
--- a/src/app/header/components/search-bar/search-bar.component.ts
+++ b/src/app/header/components/search-bar/search-bar.component.ts
@@ -1,4 +1,4 @@
-import { Component, OnInit } from '@angular/core';
+import { Component, EventEmitter, OnInit, Output } from '@angular/core';
@Component({
selector: 'app-search-bar',
@@ -7,9 +7,14 @@ import { Component, OnInit } from '@angular/core';
})
export class SearchBarComponent implements OnInit {
- constructor() { }
+@Output() searchText = new EventEmitter();
- ngOnInit(): void {
+ constructor() {}
+
+ ngOnInit(): void {}
+
+ onChangeInput(search :string) {
+ this.searchText.emit(search);
+ console.log(search);
}
-
}