mirror of
https://github.com/aspnet/JavaScriptServices.git
synced 2025-12-24 18:47:30 +00:00
feature(angular2spa): Angular 2.0, Universal 2.0, TS 2.0
This commit is contained in:
55
templates/Angular2Spa/ClientApp/main.node.ts
Normal file
55
templates/Angular2Spa/ClientApp/main.node.ts
Normal file
@@ -0,0 +1,55 @@
|
||||
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.browser.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,
|
||||
// ^ NodeModule, NodeHttpModule, NodeJsonpModule are included for server
|
||||
|
||||
// Your other imports can go here:
|
||||
FormsModule,
|
||||
|
||||
// App Routing
|
||||
RouterModule.forRoot(routes)
|
||||
]
|
||||
})
|
||||
export class MainModule {
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user