diff --git a/src/app/components/filter-side-bar/filter-side-bar.component.html b/src/app/components/filter-side-bar/filter-side-bar.component.html index b09d95f..9423810 100644 --- a/src/app/components/filter-side-bar/filter-side-bar.component.html +++ b/src/app/components/filter-side-bar/filter-side-bar.component.html @@ -36,7 +36,7 @@

Avis

- +
diff --git a/src/app/components/filter-side-bar/filter-side-bar.component.ts b/src/app/components/filter-side-bar/filter-side-bar.component.ts index c493c5e..e6aa792 100644 --- a/src/app/components/filter-side-bar/filter-side-bar.component.ts +++ b/src/app/components/filter-side-bar/filter-side-bar.component.ts @@ -1,4 +1,4 @@ -import { Component, Input, OnInit } from '@angular/core'; +import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core'; @Component({ selector: 'app-filter-side-bar', @@ -7,6 +7,8 @@ import { Component, Input, OnInit } from '@angular/core'; }) export class FilterSideBarComponent implements OnInit { @Input() listCategories: string[]; + @Output() stateNumber = new EventEmitter(); + filterStateNumber: number = 0; constructor() { this.listCategories = []; @@ -15,8 +17,12 @@ export class FilterSideBarComponent implements OnInit { ngOnInit(): void { } + onStateNumberChange(stateNumber: number): void { + this.filterStateNumber = stateNumber; + } + onSendRating():void { - console.log("coucou"); + this.stateNumber.emit(this.filterStateNumber); } } diff --git a/src/app/pages/page-accueil/page-accueil.component.html b/src/app/pages/page-accueil/page-accueil.component.html index 50b9406..20de017 100644 --- a/src/app/pages/page-accueil/page-accueil.component.html +++ b/src/app/pages/page-accueil/page-accueil.component.html @@ -1,5 +1,5 @@
- +
{ + if(product.product_rating >= stateNumber) { + this.listRate.push(product); + } + }); + this.listData = this.listRate; + console.log(this.listData); + } + }