File

src/app/components/card/card.component.ts

Metadata

selector app-card
styleUrls card.component.scss
templateUrl card.component.html

Inputs

place

Type: Place

Outputs

loadDetailPage $event type: EventEmitter<Place>
toggleFavouriteStatus $event type: EventEmitter<Place>

Constructor

constructor()

Methods

loadDetail
loadDetail(place: Place)
Returns: void
toggleFavourite
toggleFavourite(place: Place, event: Event)
Returns: void
import {Component, EventEmitter, Input, OnInit, Output} from '@angular/core';
import {Place} from "../../Place";

@Component({
  selector: 'app-card',
  templateUrl: './card.component.html',
  styleUrls: ['./card.component.scss'],
})
export class CardComponent implements OnInit {

  @Input() place: Place;
  @Output() loadDetailPage: EventEmitter<Place> = new EventEmitter()
  @Output() toggleFavouriteStatus: EventEmitter<Place> = new EventEmitter()

  constructor() { }

  ngOnInit() {}


  async loadDetail(place: Place){
    this.loadDetailPage.emit(place);
  }

  async toggleFavourite(place: Place,event: Event){
    event.stopPropagation();

    this.toggleFavouriteStatus.emit(place);
  }

}

results matching ""

    No results matching ""