diff --git a/bun.lockb b/bun.lockb
index 1c972ff..0cf4cd1 100755
Binary files a/bun.lockb and b/bun.lockb differ
diff --git a/package-lock.json b/package-lock.json
index f37723f..349e8df 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -16,7 +16,7 @@
"@angular/platform-browser": "^19.0.0",
"@angular/platform-browser-dynamic": "^19.0.0",
"@angular/router": "^19.0.0",
- "angular-in-memory-web-api": "^0.18.0",
+ "angular-in-memory-web-api": "^0.19.0",
"rxjs": "~7.8.0",
"tslib": "^2.3.0",
"zone.js": "~0.15.0"
@@ -5761,16 +5761,16 @@
}
},
"node_modules/angular-in-memory-web-api": {
- "version": "0.18.0",
- "resolved": "https://registry.npmjs.org/angular-in-memory-web-api/-/angular-in-memory-web-api-0.18.0.tgz",
- "integrity": "sha512-Eqkr9+x3d7K4dmn6Qs3ZVAfqBDPZN0N7Qel5i8eU/pe5r44J/pfxlNW+1LC2Sb2PdENEdvFzC8wx8qly5+kQyQ==",
+ "version": "0.19.0",
+ "resolved": "https://registry.npmjs.org/angular-in-memory-web-api/-/angular-in-memory-web-api-0.19.0.tgz",
+ "integrity": "sha512-o3N46wjUjqVwfJ+14tHc1K5lpSF9RA/6HqR46Mh/K6bFnYgaPiI/qcPkFLxPvTYP8uQQywVmD76q3n6kNBldzA==",
"license": "MIT",
"dependencies": {
"tslib": "^2.3.0"
},
"peerDependencies": {
- "@angular/common": "^18.0.0",
- "@angular/core": "^18.0.0",
+ "@angular/common": "^19.0.0",
+ "@angular/core": "^19.0.0",
"rxjs": "^6.5.3 || ^7.4.0"
}
},
diff --git a/package.json b/package.json
index b61f49b..bfe55a4 100644
--- a/package.json
+++ b/package.json
@@ -18,7 +18,7 @@
"@angular/platform-browser": "^19.0.0",
"@angular/platform-browser-dynamic": "^19.0.0",
"@angular/router": "^19.0.0",
- "angular-in-memory-web-api": "^0.18.0",
+ "angular-in-memory-web-api": "^0.19.0",
"rxjs": "~7.8.0",
"tslib": "^2.3.0",
"zone.js": "~0.15.0"
diff --git a/src/app/app.routes.ts b/src/app/app.routes.ts
index 959eef8..5a0345d 100644
--- a/src/app/app.routes.ts
+++ b/src/app/app.routes.ts
@@ -1,14 +1,12 @@
import { Routes } from '@angular/router';
+import { HotelListComponent } from './hotel-list/hotel-list.component';
import { TestComponent } from './test/test.component';
import { NewHotelComponent } from './new-hotel/new-hotel.component';
export const routes: Routes = [
{
path: '',
- loadComponent: () =>
- import('./hotel-list/hotel-list.component').then(
- (c) => c.HotelListComponent,
- ),
+ component: HotelListComponent,
},
{
path: 'hotels/:id',
diff --git a/src/app/hotel-list/hotel-list.component.html b/src/app/hotel-list/hotel-list.component.html
index 91d0a92..e8af120 100644
--- a/src/app/hotel-list/hotel-list.component.html
+++ b/src/app/hotel-list/hotel-list.component.html
@@ -1,5 +1,7 @@
-
{{ "hello" | uppercase | text }}
+
+
+
{{ "hello" | uppercase | text }}
CREATE NEW HOTEL
@if (hotels[0].hotelName) {
diff --git a/src/app/hotel-list/hotel-list.component.ts b/src/app/hotel-list/hotel-list.component.ts
index d95fce8..a53b07b 100644
--- a/src/app/hotel-list/hotel-list.component.ts
+++ b/src/app/hotel-list/hotel-list.component.ts
@@ -1,5 +1,5 @@
import { CommonModule, NgFor, NgIf, UpperCasePipe } from '@angular/common';
-import { Component, inject } from '@angular/core';
+import { Component, inject, ViewChild, ViewContainerRef } from '@angular/core';
import { TextPipe } from '../../text.pipe';
import { SearchComponent } from '../Search/search.component';
import { HotelService } from '../Parent/services/hotel.service';
@@ -35,7 +35,18 @@ export class HotelListComponent {
public response: any = null;
public hotels: Array
= [{} as Hotel];
- constructor(private http: HttpClient) {}
+ @ViewChild('test2', { read: ViewContainerRef })
+ private test2ViewContainerRef!: ViewContainerRef;
+
+ constructor(private http: HttpClient) { }
+
+ async loadTest2() {
+ for (let i = 0; i < 1; i++) {
+ const { Test2Component } = await import('../test2/test2.component');
+
+ this.test2ViewContainerRef.createComponent(Test2Component);
+ }
+ }
ngOnInit() {
this.http.get>('api/hotels').subscribe((res) => {
diff --git a/src/app/test2/test2.component.css b/src/app/test2/test2.component.css
new file mode 100644
index 0000000..e69de29
diff --git a/src/app/test2/test2.component.html b/src/app/test2/test2.component.html
new file mode 100644
index 0000000..0f8405e
--- /dev/null
+++ b/src/app/test2/test2.component.html
@@ -0,0 +1,6 @@
+
diff --git a/src/app/test2/test2.component.spec.ts b/src/app/test2/test2.component.spec.ts
new file mode 100644
index 0000000..5d70ad0
--- /dev/null
+++ b/src/app/test2/test2.component.spec.ts
@@ -0,0 +1,23 @@
+import { ComponentFixture, TestBed } from '@angular/core/testing';
+
+import { Test2Component } from './test2.component';
+
+describe('Test2Component', () => {
+ let component: Test2Component;
+ let fixture: ComponentFixture;
+
+ beforeEach(async () => {
+ await TestBed.configureTestingModule({
+ imports: [Test2Component]
+ })
+ .compileComponents();
+
+ fixture = TestBed.createComponent(Test2Component);
+ component = fixture.componentInstance;
+ fixture.detectChanges();
+ });
+
+ it('should create', () => {
+ expect(component).toBeTruthy();
+ });
+});
diff --git a/src/app/test2/test2.component.ts b/src/app/test2/test2.component.ts
new file mode 100644
index 0000000..abbad52
--- /dev/null
+++ b/src/app/test2/test2.component.ts
@@ -0,0 +1,11 @@
+import { Component } from '@angular/core';
+
+@Component({
+ selector: 'app-test2',
+ imports: [],
+ templateUrl: './test2.component.html',
+ styleUrl: './test2.component.css'
+})
+export class Test2Component {
+
+}