simpleat/src/app/card-resto/card-resto.component.ts
2022-02-16 12:35:13 +01:00

30 lines
623 B
TypeScript

import { Component,EventEmitter, Input, Output, OnInit } from '@angular/core';
@Component({
selector: 'app-card-resto',
templateUrl: './card-resto.component.html',
styleUrls: ['./card-resto.component.scss']
})
export class CardRestoComponent implements OnInit {
@Input() restaurant : any ;
@Input() likeResto: any;
@Output() clickLike = new EventEmitter<boolean>();
isLiked : boolean = false;
constructor() { }
ngOnInit(): void {
console.log(this.restaurant);
}
onClickLike() {
console.log('click');
this.isLiked = !this.isLiked;
this.clickLike.emit(this.isLiked);
}
}