style(docs-infra): fix docs examples for tslint rule `jsdoc-format` (#38143)

This commit updates the docs examples to be compatible with the
`jsdoc-format` tslint rule.

This is in preparation of updating the docs examples `tslint.json` to
match the one generated for new Angular CLI apps in a future commit.

PR Close #38143
This commit is contained in:
George Kalpakas 2020-07-30 13:03:12 +03:00 committed by Alex Rickabaugh
parent 77f38d3be1
commit 3012a8e71c
5 changed files with 15 additions and 8 deletions

View File

@ -1,3 +1,4 @@
// tslint:disable: jsdoc-format
// #docplaster // #docplaster
// #docregion // #docregion
// #docregion no-docs, skeleton // #docregion no-docs, skeleton

View File

@ -18,7 +18,7 @@ import { getTestHeroes } from './test-heroes';
/** /**
* FakeHeroService pretends to make real http requests. * FakeHeroService pretends to make real http requests.
* implements only as much of HeroService as is actually consumed by the app * implements only as much of HeroService as is actually consumed by the app
*/ */
export class TestHeroService extends HeroService { export class TestHeroService extends HeroService {
constructor() { constructor() {

View File

@ -2,8 +2,10 @@
import { Directive, ElementRef, Input, OnChanges } from '@angular/core'; import { Directive, ElementRef, Input, OnChanges } from '@angular/core';
@Directive({ selector: '[highlight]' }) @Directive({ selector: '[highlight]' })
/** Set backgroundColor for the attached element to highlight color /**
* and set the element's customProperty to true */ * Set backgroundColor for the attached element to highlight color
* and set the element's customProperty to true
*/
export class HighlightDirective implements OnChanges { export class HighlightDirective implements OnChanges {
defaultColor = 'rgb(211, 211, 211)'; // lightgray defaultColor = 'rgb(211, 211, 211)'; // lightgray

View File

@ -2,7 +2,7 @@
import { Pipe, PipeTransform } from '@angular/core'; import { Pipe, PipeTransform } from '@angular/core';
@Pipe({name: 'titlecase', pure: true}) @Pipe({name: 'titlecase', pure: true})
/** Transform to Title Case: uppercase the first letter of the words in a string.*/ /** Transform to Title Case: uppercase the first letter of the words in a string. */
export class TitleCasePipe implements PipeTransform { export class TitleCasePipe implements PipeTransform {
transform(input: string): string { transform(input: string): string {
return input.length === 0 ? '' : return input.length === 0 ? '' :

View File

@ -13,16 +13,20 @@
import { defer } from 'rxjs'; import { defer } from 'rxjs';
// #docregion async-data // #docregion async-data
/** Create async observable that emits-once and completes /**
* after a JS engine turn */ * Create async observable that emits-once and completes
* after a JS engine turn
*/
export function asyncData<T>(data: T) { export function asyncData<T>(data: T) {
return defer(() => Promise.resolve(data)); return defer(() => Promise.resolve(data));
} }
// #enddocregion async-data // #enddocregion async-data
// #docregion async-error // #docregion async-error
/** Create async observable error that errors /**
* after a JS engine turn */ * Create async observable error that errors
* after a JS engine turn
*/
export function asyncError<T>(errorObject: any) { export function asyncError<T>(errorObject: any) {
return defer(() => Promise.reject(errorObject)); return defer(() => Promise.reject(errorObject));
} }