Recup info des etoiles sous forme de nombre

This commit is contained in:
Julian Tomczyk 2022-01-10 15:41:09 +01:00
parent 2225415f75
commit bc93c272d4
4 changed files with 298 additions and 2 deletions

288
db.json

File diff suppressed because it is too large Load Diff

View File

@ -7,6 +7,7 @@ import { Component, OnInit } from '@angular/core';
})
export class AvisBarComponent implements OnInit {
starStates: {stateSelectedUser : boolean, stateHoverUser : boolean}[];
starStateNumber: number = 0;
constructor() {
this.starStates = [];
@ -50,13 +51,16 @@ export class AvisBarComponent implements OnInit {
}
onClickStar(starIndex: number) {
this.starStateNumber = 0;
for (let i = 0; i < this.starStates.length ; i++) {
if(i <= starIndex) {
this.starStates[i].stateSelectedUser = true;
this.starStateNumber++;
} else {
this.starStates[i].stateSelectedUser = false;
}
}
//console.log(`Rating : ${this.starStateNumber}`);
}
}

View File

@ -13,7 +13,7 @@
{{ category }}
</label>
</div>
<div *ngIf="listCategories.length == 0 ">S
<div *ngIf="listCategories.length == 0 ">
Aucune catégorie disponible
</div>
</div>
@ -37,7 +37,7 @@
<div class="flex-column justify-content-start">
<app-avis-bar></app-avis-bar>
<a href="#" class="btn btn-success me-2">Valider</a>
<button class="btn btn-success me-2" (click)="onSendRating()">Valider</button>
</div>
</div>
</ul>

View File

@ -15,4 +15,8 @@ export class FilterSideBarComponent implements OnInit {
ngOnInit(): void {
}
onSendRating():void {
console.log("coucou");
}
}