mirror of
https://github.com/aspnet/JavaScriptServices.git
synced 2025-12-22 17:47:53 +00:00
Merge branch 'rel/2.0.0-preview2' into dev
This commit is contained in:
17
templates/AngularSpa/ClientApp/app/app.module.browser.ts
Normal file
17
templates/AngularSpa/ClientApp/app/app.module.browser.ts
Normal file
@@ -0,0 +1,17 @@
|
||||
import { NgModule } from '@angular/core';
|
||||
import { BrowserModule } from '@angular/platform-browser';
|
||||
import { AppModuleShared } from './app.module.shared';
|
||||
import { AppComponent } from './components/app/app.component';
|
||||
|
||||
@NgModule({
|
||||
bootstrap: [ AppComponent ],
|
||||
imports: [
|
||||
BrowserModule,
|
||||
AppModuleShared
|
||||
],
|
||||
providers: [
|
||||
{ provide: 'ORIGIN_URL', useValue: location.origin }
|
||||
]
|
||||
})
|
||||
export class AppModule {
|
||||
}
|
||||
@@ -1,21 +0,0 @@
|
||||
import { NgModule } from '@angular/core';
|
||||
import { BrowserModule } from '@angular/platform-browser';
|
||||
import { FormsModule } from '@angular/forms';
|
||||
import { HttpModule } from '@angular/http';
|
||||
import { sharedConfig } from './app.module.shared';
|
||||
|
||||
@NgModule({
|
||||
bootstrap: sharedConfig.bootstrap,
|
||||
declarations: sharedConfig.declarations,
|
||||
imports: [
|
||||
BrowserModule,
|
||||
FormsModule,
|
||||
HttpModule,
|
||||
...sharedConfig.imports
|
||||
],
|
||||
providers: [
|
||||
{ provide: 'ORIGIN_URL', useValue: location.origin }
|
||||
]
|
||||
})
|
||||
export class AppModule {
|
||||
}
|
||||
@@ -1,13 +1,13 @@
|
||||
import { NgModule } from '@angular/core';
|
||||
import { ServerModule } from '@angular/platform-server';
|
||||
import { sharedConfig } from './app.module.shared';
|
||||
import { AppModuleShared } from './app.module.shared';
|
||||
import { AppComponent } from './components/app/app.component';
|
||||
|
||||
@NgModule({
|
||||
bootstrap: sharedConfig.bootstrap,
|
||||
declarations: sharedConfig.declarations,
|
||||
bootstrap: [ AppComponent ],
|
||||
imports: [
|
||||
ServerModule,
|
||||
...sharedConfig.imports
|
||||
AppModuleShared
|
||||
]
|
||||
})
|
||||
export class AppModule {
|
||||
|
||||
@@ -1,14 +1,16 @@
|
||||
import { NgModule } from '@angular/core';
|
||||
import { CommonModule } from '@angular/common';
|
||||
import { FormsModule } from '@angular/forms';
|
||||
import { HttpModule } from '@angular/http';
|
||||
import { RouterModule } from '@angular/router';
|
||||
|
||||
import { AppComponent } from './components/app/app.component'
|
||||
import { AppComponent } from './components/app/app.component';
|
||||
import { NavMenuComponent } from './components/navmenu/navmenu.component';
|
||||
import { HomeComponent } from './components/home/home.component';
|
||||
import { FetchDataComponent } from './components/fetchdata/fetchdata.component';
|
||||
import { CounterComponent } from './components/counter/counter.component';
|
||||
|
||||
export const sharedConfig: NgModule = {
|
||||
bootstrap: [ AppComponent ],
|
||||
@NgModule({
|
||||
declarations: [
|
||||
AppComponent,
|
||||
NavMenuComponent,
|
||||
@@ -17,6 +19,9 @@ export const sharedConfig: NgModule = {
|
||||
HomeComponent
|
||||
],
|
||||
imports: [
|
||||
CommonModule,
|
||||
HttpModule,
|
||||
FormsModule,
|
||||
RouterModule.forRoot([
|
||||
{ path: '', redirectTo: 'home', pathMatch: 'full' },
|
||||
{ path: 'home', component: HomeComponent },
|
||||
@@ -25,4 +30,6 @@ export const sharedConfig: NgModule = {
|
||||
{ path: '**', redirectTo: 'home' }
|
||||
])
|
||||
]
|
||||
};
|
||||
})
|
||||
export class AppModuleShared {
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@ import 'reflect-metadata';
|
||||
import 'zone.js';
|
||||
import { enableProdMode } from '@angular/core';
|
||||
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
|
||||
import { AppModule } from './app/app.module.client';
|
||||
import { AppModule } from './app/app.module.browser';
|
||||
|
||||
if (module['hot']) {
|
||||
module['hot'].accept();
|
||||
|
||||
Reference in New Issue
Block a user