Recup info des etoiles sous forme de nombre
This commit is contained in:
parent
2225415f75
commit
bc93c272d4
|
@ -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}`);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -15,4 +15,8 @@ export class FilterSideBarComponent implements OnInit {
|
|||
ngOnInit(): void {
|
||||
}
|
||||
|
||||
onSendRating():void {
|
||||
console.log("coucou");
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue