Skip to content

Commit b631c8f

Browse files
authored
Created a Main component to use as the application bootstrap component. (#790)
1 parent 4a0b73f commit b631c8f

File tree

3 files changed

+12
-3
lines changed

3 files changed

+12
-3
lines changed

src/app/app.module.ts

+4-2
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,19 @@ import { BrowserModule } from '@angular/platform-browser';
22
import { NgModule } from '@angular/core';
33
import { FormsModule } from '@angular/forms';
44

5+
import { MainComponent } from './main.component';
56
import { AppComponent } from './app.component';
67
import { WelcomeComponent } from './welcome.component';
78
import { LoginComponent } from './login.component';
89
import { HomeComponent } from './home.component';
9-
import { UIRouterModule, UIView } from '@uirouter/angular';
10+
import { UIRouterModule } from '@uirouter/angular';
1011
import { APP_STATES } from './app.states';
1112
import { GlobalModule } from './global/global.module';
1213
import { routerConfigFn } from './router.config';
1314

1415
@NgModule({
1516
declarations: [
17+
MainComponent,
1618
AppComponent,
1719
WelcomeComponent,
1820
LoginComponent,
@@ -29,6 +31,6 @@ import { routerConfigFn } from './router.config';
2931
BrowserModule,
3032
FormsModule
3133
],
32-
bootstrap: [UIView]
34+
bootstrap: [MainComponent]
3335
})
3436
export class AppModule { }

src/app/main.component.ts

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import { Component } from '@angular/core';
2+
3+
@Component({
4+
selector: 'app-main',
5+
template: `<ui-view>Loading...</ui-view>`
6+
})
7+
export class MainComponent {}

src/index.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,6 @@
1313
integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
1414
</head>
1515
<body>
16-
<ui-view>Loading...</ui-view>
16+
<app-main></app-main>
1717
</body>
1818
</html>

0 commit comments

Comments
 (0)