From 4d9da9b0a1e700efa8b222e3731338a9f545fd4d Mon Sep 17 00:00:00 2001 From: George Kalpakas Date: Wed, 15 Apr 2020 13:46:50 +0300 Subject: [PATCH] fix(docs-infra): align `universal` example with `toh-pt6` (#36483) As mentioned in the `universal` guide, the `toh-pt6` examples is the starting poitn for the `universal` example. However, the two examples had become out-of-sync, because some fixes/changes were made to the Tour-of-Heroes examples. This commit ports these changes to the `universal` example. PR Close #36483 --- .../universal/src/app/app.component.css | 3 +- .../examples/universal/src/app/app.module.ts | 7 ++-- .../src/app/dashboard/dashboard.component.css | 2 +- .../app/dashboard/dashboard.component.html | 2 +- .../src/app/dashboard/dashboard.component.ts | 2 +- .../app/hero-detail/hero-detail.component.css | 1 - .../hero-detail/hero-detail.component.html | 2 +- .../app/hero-detail/hero-detail.component.ts | 6 +-- .../hero-search/hero-search.component.html | 4 +- .../app/hero-search/hero-search.component.ts | 6 +-- .../universal/src/app/hero.service.ts | 41 ++++++++++--------- .../src/app/heroes/heroes.component.css | 8 ++-- .../src/app/heroes/heroes.component.html | 2 +- .../src/app/heroes/heroes.component.ts | 8 ++-- .../src/app/in-memory-data.service.ts | 14 +++++++ .../universal/src/app/message.service.ts | 2 +- .../src/app/messages/messages.component.css | 2 +- aio/content/examples/universal/src/main.ts | 3 +- 18 files changed, 64 insertions(+), 51 deletions(-) diff --git a/aio/content/examples/universal/src/app/app.component.css b/aio/content/examples/universal/src/app/app.component.css index bf741e4575..c1d8721226 100644 --- a/aio/content/examples/universal/src/app/app.component.css +++ b/aio/content/examples/universal/src/app/app.component.css @@ -1,7 +1,6 @@ /* AppComponent's private CSS styles */ h1 { font-size: 1.2em; - color: #999; margin-bottom: 0; } h2 { @@ -18,7 +17,7 @@ nav a { border-radius: 4px; } nav a:visited, a:link { - color: #607D8B; + color: #334953; } nav a:hover { color: #039be5; diff --git a/aio/content/examples/universal/src/app/app.module.ts b/aio/content/examples/universal/src/app/app.module.ts index 1dab81e17b..ed6e1a32db 100644 --- a/aio/content/examples/universal/src/app/app.module.ts +++ b/aio/content/examples/universal/src/app/app.module.ts @@ -14,8 +14,6 @@ import { DashboardComponent } from './dashboard/dashboard.component'; import { HeroDetailComponent } from './hero-detail/hero-detail.component'; import { HeroesComponent } from './heroes/heroes.component'; import { HeroSearchComponent } from './hero-search/hero-search.component'; -import { HeroService } from './hero.service'; -import { MessageService } from './message.service'; import { MessagesComponent } from './messages/messages.component'; // #docregion platform-detection @@ -32,6 +30,10 @@ import { isPlatformBrowser } from '@angular/common'; FormsModule, AppRoutingModule, HttpClientModule, + + // The HttpClientInMemoryWebApiModule module intercepts HTTP requests + // and returns simulated server responses. + // Remove it when a real server is ready to receive requests. HttpClientInMemoryWebApiModule.forRoot( InMemoryDataService, { dataEncapsulation: false } ) @@ -44,7 +46,6 @@ import { isPlatformBrowser } from '@angular/common'; MessagesComponent, HeroSearchComponent ], - providers: [ HeroService, MessageService ], bootstrap: [ AppComponent ] }) export class AppModule { diff --git a/aio/content/examples/universal/src/app/dashboard/dashboard.component.css b/aio/content/examples/universal/src/app/dashboard/dashboard.component.css index 6222c23bb7..938b84b2b0 100644 --- a/aio/content/examples/universal/src/app/dashboard/dashboard.component.css +++ b/aio/content/examples/universal/src/app/dashboard/dashboard.component.css @@ -34,7 +34,7 @@ h4 { color: #eee; max-height: 120px; min-width: 120px; - background-color: #607D8B; + background-color: #3f525c; border-radius: 2px; } .module:hover { diff --git a/aio/content/examples/universal/src/app/dashboard/dashboard.component.html b/aio/content/examples/universal/src/app/dashboard/dashboard.component.html index 36e86053a6..b70c0c7d6e 100644 --- a/aio/content/examples/universal/src/app/dashboard/dashboard.component.html +++ b/aio/content/examples/universal/src/app/dashboard/dashboard.component.html @@ -8,4 +8,4 @@ - + diff --git a/aio/content/examples/universal/src/app/dashboard/dashboard.component.ts b/aio/content/examples/universal/src/app/dashboard/dashboard.component.ts index f152c10c7e..c559ccdd4d 100644 --- a/aio/content/examples/universal/src/app/dashboard/dashboard.component.ts +++ b/aio/content/examples/universal/src/app/dashboard/dashboard.component.ts @@ -18,6 +18,6 @@ export class DashboardComponent implements OnInit { getHeroes(): void { this.heroService.getHeroes() - .subscribe(heroes => this.heroes = heroes.slice(1, 5)); + .subscribe(heroes => this.heroes = heroes.slice(1, 5)); } } diff --git a/aio/content/examples/universal/src/app/hero-detail/hero-detail.component.css b/aio/content/examples/universal/src/app/hero-detail/hero-detail.component.css index 3981760d49..835a13de5b 100644 --- a/aio/content/examples/universal/src/app/hero-detail/hero-detail.component.css +++ b/aio/content/examples/universal/src/app/hero-detail/hero-detail.component.css @@ -19,7 +19,6 @@ button { padding: 5px 10px; border-radius: 4px; cursor: pointer; - cursor: hand; } button:hover { background-color: #cfd8dc; diff --git a/aio/content/examples/universal/src/app/hero-detail/hero-detail.component.html b/aio/content/examples/universal/src/app/hero-detail/hero-detail.component.html index 6fa498ee4f..7ac41967f9 100644 --- a/aio/content/examples/universal/src/app/hero-detail/hero-detail.component.html +++ b/aio/content/examples/universal/src/app/hero-detail/hero-detail.component.html @@ -1,5 +1,5 @@
-

{{ hero.name | uppercase }} Details

+

{{hero.name | uppercase}} Details

id: {{hero.id}}