-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapartments.component.ts
More file actions
46 lines (37 loc) · 1.72 KB
/
apartments.component.ts
File metadata and controls
46 lines (37 loc) · 1.72 KB
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
import { Component } from '@angular/core';
interface Apartment {
apartNum: number;
floorNum: number;
surface: number;
terrace: boolean;
surfaceterrace: number;
category: string;
residenceId: number;
}
@Component({
selector: 'app-apartments',
templateUrl: './apartments.component.html',
styleUrls: ['./apartments.component.scss']
})
export class ApartmentsComponent {
apartments: Apartment[] = [
// Apartments for Residence 1
{ apartNum: 101, floorNum: 1, surface: 80, terrace: true, surfaceterrace: 10, category: 'T2', residenceId: 1 },
{ apartNum: 102, floorNum: 2, surface: 100, terrace: false, surfaceterrace: 0, category: 'T3', residenceId: 1 },
// Apartments for Residence 2
{ apartNum: 201, floorNum: 1, surface: 70, terrace: false, surfaceterrace: 0, category: 'Studio', residenceId: 2 },
{ apartNum: 202, floorNum: 3, surface: 110, terrace: true, surfaceterrace: 15, category: 'T4', residenceId: 2 },
// Apartments for Residence 3
{ apartNum: 301, floorNum: 2, surface: 90, terrace: true, surfaceterrace: 12, category: 'T3', residenceId: 3 },
{ apartNum: 302, floorNum: 1, surface: 75, terrace: false, surfaceterrace: 0, category: 'T2', residenceId: 3 },
// Apartments for Residence 4
{ apartNum: 401, floorNum: 1, surface: 85, terrace: true, surfaceterrace: 8, category: 'T3', residenceId: 4 },
{ apartNum: 402, floorNum: 2, surface: 95, terrace: false, surfaceterrace: 0, category: 'T2', residenceId: 4 }
];
viewDetails(apartment: Apartment) {
alert(`Viewing details for Apartment ${apartment.apartNum} in Residence ${apartment.residenceId}`);
}
addToFavorites(apartment: Apartment) {
alert(`Added Apartment ${apartment.apartNum} to favorites!`);
}
}