Files
JavaScriptServices/templates/Angular2Spa/ClientApp/main.browser.ts
2016-09-19 09:12:03 +01:00

56 lines
1.1 KiB
TypeScript

import { NgModule } from '@angular/core';
import { FormsModule } from '@angular/forms';
import { RouterModule } from '@angular/router';
import { UniversalModule } from 'angular2-universal';
import {
App,
Counter,
FetchData,
Home,
NavMenu
} from './components';
import { routes } from './routes';
/* NOTE :
This file and `main.node.ts` are identical, at the moment(!)
By splitting these, you're able to create logic, imports, etc
that are "Platform" specific.
If you want your code to be completely Universal and don't need that
You can also just have 1 file, that is imported into both
* boot-client
* boot-server
*/
// ** Top-level NgModule "container" **
@NgModule({
// Root App Component
bootstrap: [ App ],
// Our Components
declarations: [
App, Counter, FetchData, Home, NavMenu
],
imports: [
// * NOTE: Needs to be your first import (!)
UniversalModule,
// * ^ BrowserModule, HttpModule, and JsonpModule are included here
// Your other imports can go here :
FormsModule,
// App Routing
RouterModule.forRoot(routes)
]
})
export class MainModule {
}