This repository has been archived by the owner on Apr 3, 2022. It is now read-only.
forked from johnpapa/angular-tour-of-heroes
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move the components to their own modules.
- Loading branch information
Showing
19 changed files
with
106 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,30 @@ | ||
import { BrowserModule } from '@angular/platform-browser'; | ||
import { NgModule } from '@angular/core'; | ||
import { FormsModule } from '@angular/forms'; | ||
import { HttpModule } from '@angular/http'; | ||
import {BrowserModule} from '@angular/platform-browser'; | ||
import {NgModule} from '@angular/core'; | ||
import {HttpModule} from '@angular/http'; | ||
|
||
import { InMemoryWebApiModule } from 'angular-in-memory-web-api'; | ||
import { InMemoryDataService } from './in-memory-data.service'; | ||
import {InMemoryWebApiModule} from 'angular-in-memory-web-api'; | ||
import {InMemoryDataService} from './in-memory-data.service'; | ||
|
||
import { AppComponent } from './app.component'; | ||
import { AppRoutingModule } from './app-routing.module'; | ||
import { HeroService } from './hero.service'; | ||
import { DashboardComponent } from './dashboard.component'; | ||
import { HeroesComponent } from './heroes.component'; | ||
import { HeroDetailComponent } from './hero-detail.component'; | ||
import { HeroSearchComponent } from './hero-search.component'; | ||
import {AppComponent} from './app.component'; | ||
import {AppRoutingModule} from './app-routing.module'; | ||
import {HeroService} from './hero.service'; | ||
import {DashboardModule} from './dashboard/dashboard.module'; | ||
import {HeroesModule} from './heroes/heroes.module'; | ||
|
||
@NgModule({ | ||
imports: [ | ||
BrowserModule, | ||
FormsModule, | ||
AppRoutingModule, | ||
HttpModule, | ||
InMemoryWebApiModule.forRoot(InMemoryDataService, { delay: 600 }) | ||
InMemoryWebApiModule.forRoot(InMemoryDataService, {delay: 600}), | ||
DashboardModule, | ||
HeroesModule | ||
], | ||
declarations: [ | ||
AppComponent, | ||
DashboardComponent, | ||
HeroSearchComponent, | ||
HeroesComponent, | ||
HeroDetailComponent, | ||
AppComponent | ||
], | ||
providers: [HeroService], | ||
bootstrap: [AppComponent] | ||
}) | ||
export class AppModule { } | ||
export class AppModule { | ||
} |
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions
4
src/app/dashboard.component.ts → src/app/dashboard/dashboard.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import {NgModule} from '@angular/core'; | ||
import {CommonModule} from '@angular/common'; | ||
|
||
import {DashboardComponent} from './dashboard.component'; | ||
import {HeroSearchModule} from '../hero-search/hero-search.module'; | ||
|
||
@NgModule({ | ||
imports: [ | ||
CommonModule, | ||
HeroSearchModule | ||
], | ||
declarations: [ | ||
DashboardComponent | ||
], | ||
exports: [ | ||
DashboardComponent | ||
], | ||
providers: [] | ||
}) | ||
export class DashboardModule { } |
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions
4
src/app/hero-detail.component.ts → src/app/hero-detail/hero-detail.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import {NgModule} from '@angular/core'; | ||
import {CommonModule} from '@angular/common'; | ||
import {HeroDetailComponent} from './hero-detail.component'; | ||
import {FormsModule} from '@angular/forms'; | ||
|
||
@NgModule({ | ||
imports: [ | ||
CommonModule, | ||
FormsModule | ||
], | ||
declarations: [ | ||
HeroDetailComponent | ||
], | ||
exports: [ | ||
HeroDetailComponent | ||
], | ||
providers: [] | ||
}) | ||
export class HeroDetailModule { } |
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import {NgModule} from '@angular/core'; | ||
import {CommonModule} from '@angular/common'; | ||
import {HeroSearchComponent} from './hero-search.component'; | ||
import {HeroSearchService} from './hero-search.service'; | ||
|
||
@NgModule({ | ||
imports: [ | ||
CommonModule | ||
], | ||
declarations: [ | ||
HeroSearchComponent | ||
], | ||
exports: [ | ||
HeroSearchComponent | ||
], | ||
providers: [HeroSearchService] | ||
}) | ||
export class HeroSearchModule { | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions
4
src/app/heroes.component.ts → src/app/heroes/heroes.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import {NgModule} from '@angular/core'; | ||
import {CommonModule} from '@angular/common'; | ||
import {HeroesComponent} from './heroes.component'; | ||
import {HeroDetailModule} from '../hero-detail/hero-detail.module'; | ||
|
||
@NgModule({ | ||
imports: [ | ||
CommonModule, | ||
HeroDetailModule | ||
], | ||
declarations: [ | ||
HeroesComponent | ||
], | ||
exports: [ | ||
HeroesComponent | ||
], | ||
providers: [] | ||
}) | ||
export class HeroesModule { | ||
} |