cards-list.component.ts 665 Bytes
Newer Older
Mamadou Diallo's avatar
Mamadou Diallo committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
import { Component, OnInit } from '@angular/core';
import {Observable} from "rxjs";
import {Card} from "../card";
import {CardService} from "../card.service";
import {Router} from "@angular/router";

@Component({
  selector: 'app-cards-list',
  templateUrl: './cards-list.component.html',
  styleUrls: ['./cards-list.component.css']
})
export class CardsListComponent implements OnInit {

  cards: Observable<Card[]>;
  constructor(private cardService: CardService, private router: Router) { }

  ngOnInit(): void {
    this.reloadData();
  }

  reloadData(){
    this.cards = null;
  }

  cardDetails(id: Object){
    this.router.navigate(['details', id]);
  }

}