From 061107c5f6ed9d9511a323e3673a27779499bd5a Mon Sep 17 00:00:00 2001 From: George Kalpakas Date: Wed, 15 Apr 2020 13:46:47 +0300 Subject: [PATCH] style(docs-infra): clean up Tour-of-Heroes examples (#36483) I noticed these minor styling issues while aligning the `universal` examples with the `toh-pt6` example (in a subsequent commit). PR Close #36483 --- .../src/app/hero-detail/hero-detail.component.css | 1 - aio/content/examples/toh-pt6/src/app/app.module.ts | 3 +-- .../src/app/hero-detail/hero-detail.component.css | 2 +- .../src/app/hero-detail/hero-detail.component.ts | 6 +++--- aio/content/examples/toh-pt6/src/app/hero.service.ts | 10 +++++----- .../toh-pt6/src/app/heroes/heroes.component.css | 4 ++-- .../examples/toh-pt6/src/app/in-memory-data.service.ts | 2 +- 7 files changed, 13 insertions(+), 15 deletions(-) diff --git a/aio/content/examples/toh-pt5/src/app/hero-detail/hero-detail.component.css b/aio/content/examples/toh-pt5/src/app/hero-detail/hero-detail.component.css index 3981760d49..835a13de5b 100644 --- a/aio/content/examples/toh-pt5/src/app/hero-detail/hero-detail.component.css +++ b/aio/content/examples/toh-pt5/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/toh-pt6/src/app/app.module.ts b/aio/content/examples/toh-pt6/src/app/app.module.ts index f2ba5ba879..db08f4a4df 100644 --- a/aio/content/examples/toh-pt6/src/app/app.module.ts +++ b/aio/content/examples/toh-pt6/src/app/app.module.ts @@ -1,5 +1,5 @@ // #docplaster -// #docregion, v1 +// #docregion , v1 import { NgModule } from '@angular/core'; import { BrowserModule } from '@angular/platform-browser'; import { FormsModule } from '@angular/forms'; @@ -59,6 +59,5 @@ import { MessagesComponent } from './messages/messages.component'; // #docregion import-httpclientmodule }) // #enddocregion import-httpclientmodule - export class AppModule { } // #enddocregion , v1 diff --git a/aio/content/examples/toh-pt6/src/app/hero-detail/hero-detail.component.css b/aio/content/examples/toh-pt6/src/app/hero-detail/hero-detail.component.css index 062544af48..835a13de5b 100644 --- a/aio/content/examples/toh-pt6/src/app/hero-detail/hero-detail.component.css +++ b/aio/content/examples/toh-pt6/src/app/hero-detail/hero-detail.component.css @@ -18,7 +18,7 @@ button { border: none; padding: 5px 10px; border-radius: 4px; - cursor: pointer; cursor: hand; + cursor: pointer; } button:hover { background-color: #cfd8dc; diff --git a/aio/content/examples/toh-pt6/src/app/hero-detail/hero-detail.component.ts b/aio/content/examples/toh-pt6/src/app/hero-detail/hero-detail.component.ts index d1259eebf0..18c7d8f93f 100644 --- a/aio/content/examples/toh-pt6/src/app/hero-detail/hero-detail.component.ts +++ b/aio/content/examples/toh-pt6/src/app/hero-detail/hero-detail.component.ts @@ -33,10 +33,10 @@ export class HeroDetailComponent implements OnInit { this.location.back(); } - // #docregion save - save(): void { + // #docregion save + save(): void { this.heroService.updateHero(this.hero) .subscribe(() => this.goBack()); } -// #enddocregion save + // #enddocregion save } diff --git a/aio/content/examples/toh-pt6/src/app/hero.service.ts b/aio/content/examples/toh-pt6/src/app/hero.service.ts index 740b822313..5bc7168441 100644 --- a/aio/content/examples/toh-pt6/src/app/hero.service.ts +++ b/aio/content/examples/toh-pt6/src/app/hero.service.ts @@ -36,7 +36,7 @@ export class HeroService { // #docregion getHeroes, getHeroes-1 /** GET heroes from the server */ // #docregion getHeroes-2 - getHeroes (): Observable { + getHeroes(): Observable { return this.http.get(this.heroesUrl) // #enddocregion getHeroes-1 .pipe( @@ -98,7 +98,7 @@ export class HeroService { // #docregion addHero /** POST: add a new hero to the server */ - addHero (hero: Hero): Observable { + addHero(hero: Hero): Observable { return this.http.post(this.heroesUrl, hero, this.httpOptions).pipe( tap((newHero: Hero) => this.log(`added hero w/ id=${newHero.id}`)), catchError(this.handleError('addHero')) @@ -108,7 +108,7 @@ export class HeroService { // #docregion deleteHero /** DELETE: delete the hero from the server */ - deleteHero (hero: Hero | number): Observable { + deleteHero(hero: Hero | number): Observable { const id = typeof hero === 'number' ? hero : hero.id; const url = `${this.heroesUrl}/${id}`; @@ -121,7 +121,7 @@ export class HeroService { // #docregion updateHero /** PUT: update the hero on the server */ - updateHero (hero: Hero): Observable { + updateHero(hero: Hero): Observable { return this.http.put(this.heroesUrl, hero, this.httpOptions).pipe( tap(_ => this.log(`updated hero id=${hero.id}`)), catchError(this.handleError('updateHero')) @@ -136,7 +136,7 @@ export class HeroService { * @param operation - name of the operation that failed * @param result - optional value to return as the observable result */ - private handleError (operation = 'operation', result?: T) { + private handleError(operation = 'operation', result?: T) { return (error: any): Observable => { // TODO: send the error to remote logging infrastructure diff --git a/aio/content/examples/toh-pt6/src/app/heroes/heroes.component.css b/aio/content/examples/toh-pt6/src/app/heroes/heroes.component.css index 0b13f0fe4c..9046623926 100644 --- a/aio/content/examples/toh-pt6/src/app/heroes/heroes.component.css +++ b/aio/content/examples/toh-pt6/src/app/heroes/heroes.component.css @@ -30,7 +30,7 @@ } .heroes a:hover { - color:#607D8B; + color: #607D8B; } .heroes .badge { @@ -38,7 +38,7 @@ font-size: small; color: white; padding: 0.8em 0.7em 0 0.7em; - background-color:#405061; + background-color: #405061; line-height: 1em; position: relative; left: -1px; diff --git a/aio/content/examples/toh-pt6/src/app/in-memory-data.service.ts b/aio/content/examples/toh-pt6/src/app/in-memory-data.service.ts index cb95d5eae5..db97393d75 100644 --- a/aio/content/examples/toh-pt6/src/app/in-memory-data.service.ts +++ b/aio/content/examples/toh-pt6/src/app/in-memory-data.service.ts @@ -1,7 +1,7 @@ // #docregion , init +import { Injectable } from '@angular/core'; import { InMemoryDbService } from 'angular-in-memory-web-api'; import { Hero } from './hero'; -import { Injectable } from '@angular/core'; @Injectable({ providedIn: 'root',