diff --git a/first-app/src/app/home/home.html b/first-app/src/app/home/home.html index c7be4eb..8e66c3f 100644 --- a/first-app/src/app/home/home.html +++ b/first-app/src/app/home/home.html @@ -1,9 +1,12 @@
-
+ +
- + @for(housingLocation of housingLocationList; track $index) { + + }
\ No newline at end of file diff --git a/first-app/src/app/home/home.ts b/first-app/src/app/home/home.ts index d0cd17c..e0d6d3f 100644 --- a/first-app/src/app/home/home.ts +++ b/first-app/src/app/home/home.ts @@ -6,20 +6,111 @@ import {HousingLocationInfo} from '../housinglocation'; // Importation de l'inte @Component({ selector: 'app-home', imports: [HousingLocation], - templateUrl: './home.html', + templateUrl: 'home.html', styleUrls: ['./home.css'], }) - export class Home { readonly baseUrl = 'https://angular.dev/assets/images/tutorials/common'; - housingLocation: HousingLocationInfo = { - id: 9999, - name: 'Test Home', - city: 'Test city', - state: 'ST', - photo: `${this.baseUrl}/example-house.jpg`, - availableUnits: 99, - wifi: true, - laundry: false, - }; -} + housingLocationList: HousingLocationInfo[] = [ + { + id: 0, + name: 'Acme Fresh Start Housing', + city: 'Chicago', + state: 'IL', + photo: `${this.baseUrl}/bernard-hermant-CLKGGwIBTaY-unsplash.jpg`, + availableUnits: 4, + wifi: true, + laundry: true, + }, + { + id: 1, + name: 'A113 Transitional Housing', + city: 'Santa Monica', + state: 'CA', + photo: `${this.baseUrl}/brandon-griggs-wR11KBaB86U-unsplash.jpg`, + availableUnits: 0, + wifi: false, + laundry: true, + }, + { + id: 2, + name: 'Warm Beds Housing Support', + city: 'Juneau', + state: 'AK', + photo: `${this.baseUrl}/i-do-nothing-but-love-lAyXdl1-Wmc-unsplash.jpg`, + availableUnits: 1, + wifi: false, + laundry: false, + }, + { + id: 3, + name: 'Homesteady Housing', + city: 'Chicago', + state: 'IL', + photo: `${this.baseUrl}/ian-macdonald-W8z6aiwfi1E-unsplash.jpg`, + availableUnits: 1, + wifi: true, + laundry: false, + }, + { + id: 4, + name: 'Happy Homes Group', + city: 'Gary', + state: 'IN', + photo: `${this.baseUrl}/krzysztof-hepner-978RAXoXnH4-unsplash.jpg`, + availableUnits: 1, + wifi: true, + laundry: false, + }, + { + id: 5, + name: 'Hopeful Apartment Group', + city: 'Oakland', + state: 'CA', + photo: `${this.baseUrl}/r-architecture-JvQ0Q5IkeMM-unsplash.jpg`, + availableUnits: 2, + wifi: true, + laundry: true, + }, + { + id: 6, + name: 'Seriously Safe Towns', + city: 'Oakland', + state: 'CA', + photo: `${this.baseUrl}/phil-hearing-IYfp2Ixe9nM-unsplash.jpg`, + availableUnits: 5, + wifi: true, + laundry: true, + }, + { + id: 7, + name: 'Hopeful Housing Solutions', + city: 'Oakland', + state: 'CA', + photo: `${this.baseUrl}/r-architecture-GGupkreKwxA-unsplash.jpg`, + availableUnits: 2, + wifi: true, + laundry: true, + }, + { + id: 8, + name: 'Seriously Safe Towns', + city: 'Oakland', + state: 'CA', + photo: `${this.baseUrl}/saru-robert-9rP3mxf8qWI-unsplash.jpg`, + availableUnits: 10, + wifi: false, + laundry: false, + }, + { + id: 9, + name: 'Capital Safe Towns', + city: 'Portland', + state: 'OR', + photo: `${this.baseUrl}/webaliser-_TPTXZd9mOo-unsplash.jpg`, + availableUnits: 6, + wifi: true, + laundry: true, + }, + ]; +} \ No newline at end of file diff --git a/first-app/src/app/housing-location/housing-location.html b/first-app/src/app/housing-location/housing-location.html new file mode 100644 index 0000000..5628f54 --- /dev/null +++ b/first-app/src/app/housing-location/housing-location.html @@ -0,0 +1,6 @@ +
+ Exterior photo of {{ housingLocation().name }} +

{{ housingLocation().name }}

+

{{ housingLocation().city }}, {{ housingLocation().state }}

+
\ No newline at end of file diff --git a/first-app/src/app/housing-location/housing-location.ts b/first-app/src/app/housing-location/housing-location.ts index c96a357..0e98a15 100644 --- a/first-app/src/app/housing-location/housing-location.ts +++ b/first-app/src/app/housing-location/housing-location.ts @@ -3,11 +3,7 @@ import {HousingLocationInfo} from '../housinglocation'; // Interface @Component({ selector: 'app-housing-location', imports: [], - template: ` -

- housing-location works! -

- `, + templateUrl: './housing-location.html', styleUrls: ['./housing-location.css'], }) export class HousingLocation {