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:
parent
77f38d3be1
commit
3012a8e71c
|
@ -1,3 +1,4 @@
|
||||||
|
// tslint:disable: jsdoc-format
|
||||||
// #docplaster
|
// #docplaster
|
||||||
// #docregion
|
// #docregion
|
||||||
// #docregion no-docs, skeleton
|
// #docregion no-docs, skeleton
|
||||||
|
|
|
@ -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
|
||||||
|
|
|
@ -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));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue