Skip to content

Commit b81172c

Browse files
committed
Extract existing booking code into new app
1 parent a2c6238 commit b81172c

File tree

10 files changed

+21
-57
lines changed

10 files changed

+21
-57
lines changed

projects/bookings/src/app/app.component.ts

Lines changed: 0 additions & 32 deletions
This file was deleted.

projects/bookings/src/app/app.module.ts

Lines changed: 0 additions & 16 deletions
This file was deleted.

projects/train-platform/src/booking/booking-form/booking-form.component.ts renamed to projects/bookings/src/app/booking-form/booking-form.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { filter, map } from 'rxjs/operators';
77
import { BookingService } from '../booking.service';
88

99
@Component({
10-
selector: 'app-booking-form',
10+
selector: 'mf-booking-form',
1111
templateUrl: './booking-form.component.html',
1212
styleUrls: ['./booking-form.component.css'],
1313
})
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import { Component } from '@angular/core';
2+
3+
@Component({
4+
selector: 'mf-booking',
5+
template: `<router-outlet></router-outlet>`,
6+
styles: [],
7+
})
8+
export class BookingComponent {}
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,29 @@
11
import { CommonModule } from '@angular/common';
22
import { NgModule } from '@angular/core';
33
import { FormsModule } from '@angular/forms';
4+
import { BrowserModule } from '@angular/platform-browser';
45
import { RouterModule } from '@angular/router';
56
import { HotToastModule } from '@ngneat/hot-toast';
67
import { TranslateModule } from '@ngx-translate/core';
78
import { BookingFormComponent } from './booking-form/booking-form.component';
9+
import { BookingComponent } from './booking.component';
810

911
@NgModule({
10-
declarations: [BookingFormComponent],
12+
declarations: [BookingComponent, BookingFormComponent],
1113
imports: [
14+
BrowserModule,
1215
CommonModule,
1316
FormsModule,
14-
RouterModule.forChild([
17+
RouterModule.forRoot([
1518
{
1619
path: 'journey/:journeyId',
1720
component: BookingFormComponent,
1821
data: { title: 'Book journey' },
1922
},
2023
]),
2124
HotToastModule.forRoot(),
22-
TranslateModule.forChild(),
25+
TranslateModule.forRoot(),
2326
],
27+
bootstrap: [BookingComponent],
2428
})
2529
export class BookingModule {}

projects/bookings/src/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,6 @@
88
<link rel="icon" type="image/x-icon" href="favicon.ico">
99
</head>
1010
<body>
11-
<mf-root></mf-root>
11+
<mf-booking></mf-booking>
1212
</body>
1313
</html>

projects/bookings/src/main.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
import { enableProdMode } from '@angular/core';
22
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
3-
4-
import { AppModule } from './app/app.module';
3+
import { BookingModule } from './app/booking.module';
54
import { environment } from './environments/environment';
65

76
if (environment.production) {
87
enableProdMode();
98
}
109

11-
platformBrowserDynamic().bootstrapModule(AppModule)
12-
.catch(err => console.error(err));
10+
platformBrowserDynamic()
11+
.bootstrapModule(BookingModule)
12+
.catch((err) => console.error(err));

0 commit comments

Comments
 (0)