-
Notifications
You must be signed in to change notification settings - Fork 1.2k
/
Copy pathmain.module.js
48 lines (45 loc) · 1.36 KB
/
main.module.js
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
47
48
import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { FormsModule } from '@angular/forms';
<%_ if(filters.uirouter) { %>
import { UIRouterModule } from 'ui-router-ng2';<% } %>
<%_ if(filters.ngroute) { %>
import { RouterModule, Routes } from '@angular/router';<% } %>
<%_ if(filters.uibootstrap) { %>
import { TooltipModule } from 'ng2-bootstrap/ng2-bootstrap';<% } %>
import { MainComponent } from './main.component';
<%_ if(filters.socketio) { -%>
import { SocketService } from '../../components/socket/socket.service';<% } %>
<%_ if(filters.ngroute) { _%>
export const ROUTES: Routes = [
{ path: '', component: MainComponent },
];<% } %>
<%_ if(filters.uirouter) { _%>
export const STATES = [
{ name: 'main', url: '/', component: MainComponent },
];<% } %>
@NgModule({
imports: [
BrowserModule,
FormsModule,
<%_ if(filters.ngroute) { _%>
RouterModule.forChild(ROUTES),<% } %>
<%_ if(filters.uirouter) { _%>
UIRouterModule.forChild({
states: STATES,
}),<% } %>
<%_ if(filters.uibootstrap) { %>
TooltipModule,<% } %>
],
declarations: [
MainComponent,
],
<%_ if(filters.socketio) { -%>
providers: [
SocketService,
],<% } %>
exports: [
MainComponent,
],
})
export class MainModule {}