Service restoByCat + icone
This commit is contained in:
parent
48d4b68b9b
commit
1b520593cd
7 changed files with 110 additions and 63 deletions
|
|
@ -4,7 +4,7 @@
|
|||
<div class="card-body rounded-bottom">
|
||||
|
||||
|
||||
<a routerLink="../restaurants" class="btn">{{ categoryData.libelle }}</a>
|
||||
<a routerLink="../restaurants" class="btn" (click)="onClickCateg(categoryData.id)">{{ categoryData.libelle }}</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
|
@ -1,4 +1,6 @@
|
|||
import { Component, Input, OnInit } from '@angular/core';
|
||||
import { Router } from '@angular/router';
|
||||
import { ApiBackService } from '../services/api-back.service';
|
||||
|
||||
@Component({
|
||||
selector: 'app-card-category',
|
||||
|
|
@ -9,9 +11,20 @@ export class CardCategoryComponent implements OnInit {
|
|||
|
||||
@Input() categoryData : any;
|
||||
|
||||
constructor() { }
|
||||
constructor(private apiBackService : ApiBackService, private route : Router) { }
|
||||
|
||||
ngOnInit(): void {
|
||||
}
|
||||
|
||||
onClickCateg(id : number){
|
||||
|
||||
|
||||
this.apiBackService.getRestaurantsByCateg(id);
|
||||
|
||||
this.route.navigate(['restaurants']);
|
||||
|
||||
//console.log('salut les copains');
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue