source: bus-n-go-pavel-216049/bus-n-go-frontend/src/app/components/tickets-page/tickets-page.component.ts@ bfb90dd

Last change on this file since bfb90dd was baf4cc4, checked in by ppaunovski <paunovskipavel@…>, 3 months ago

split group project and individual project into two separate folders

  • Property mode set to 100644
File size: 898 bytes
Line 
1import {Component, OnInit} from '@angular/core';
2import {TicketService} from "../../services/ticket/ticket.service";
3import {TicketResponse} from "../../model/responses/TicketResponse";
4import {TicketComponent} from "../ticket/ticket.component";
5import {RouterLink} from "@angular/router";
6import {MatButton, MatButtonModule} from "@angular/material/button";
7
8@Component({
9 selector: 'app-tickets-page',
10 standalone: true,
11 imports: [
12 TicketComponent,
13 RouterLink,
14 MatButtonModule
15 ],
16 templateUrl: './tickets-page.component.html',
17})
18export class TicketsPageComponent implements OnInit{
19
20 tickets: TicketResponse[] = []
21
22 constructor(private service: TicketService) {
23 }
24
25 ngOnInit(): void {
26 this.service.getTickets().subscribe({
27 next: response => {
28 console.log(response);
29 this.tickets = response
30 }
31 })
32 }
33
34}
Note: See TracBrowser for help on using the repository browser.