From 17e289c39f458ca10d5dd974fe1cbb8db9f0681b Mon Sep 17 00:00:00 2001 From: Judy Bogart Date: Tue, 6 Aug 2019 08:08:02 -0700 Subject: [PATCH] docs: correct description of output decorator and add links to guide (#31780) PR Close #31780 --- aio/content/guide/observables-in-angular.md | 8 ++++---- packages/core/src/event_emitter.ts | 2 +- packages/core/src/metadata/directives.ts | 4 ++++ 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/aio/content/guide/observables-in-angular.md b/aio/content/guide/observables-in-angular.md index a8648bf454..632780513e 100644 --- a/aio/content/guide/observables-in-angular.md +++ b/aio/content/guide/observables-in-angular.md @@ -2,17 +2,17 @@ Angular makes use of observables as an interface to handle a variety of common asynchronous operations. For example: -* The `EventEmitter` class lets you use observables with the Angular `@Output` decorator. +* You can define [custom events](guide/template-syntax#custom-events-with-eventemitter) that send observable output data from a child to a parent component. * The HTTP module uses observables to handle AJAX requests and responses. * The Router and Forms modules use observables to listen for and respond to user-input events. -## Event emitter +## Transmitting data between components -Angular provides an `EventEmitter` class that is used when publishing values from a component through the `@Output()` decorator. +Angular provides an `EventEmitter` class that is used when publishing values from a component through the [`@Output()` decorator](guide/template-syntax#how-to-use-output). `EventEmitter` extends [RxJS `Subject`](https://rxjs.dev/api/index/class/Subject), adding an `emit()` method so it can send arbitrary values. When you call `emit()`, it passes the emitted value to the `next()` method of any subscribed observer. -A good example of usage can be found on the [EventEmitter](https://angular.io/api/core/EventEmitter) documentation. Here is the example component that listens for open and close events: +A good example of usage can be found in the [EventEmitter](https://angular.io/api/core/EventEmitter) documentation. Here is the example component that listens for open and close events: `` diff --git a/packages/core/src/event_emitter.ts b/packages/core/src/event_emitter.ts index d30ccf9a51..e7b255072b 100644 --- a/packages/core/src/event_emitter.ts +++ b/packages/core/src/event_emitter.ts @@ -58,7 +58,7 @@ import {Subject, Subscription} from 'rxjs'; * * ``` * - * @see [Observables: Event emitter](guide/observables-in-angular#event-emitter) + * @see [Observables in Angular](guide/observables-in-angular) * @publicApi */ export class EventEmitter extends Subject { diff --git a/packages/core/src/metadata/directives.ts b/packages/core/src/metadata/directives.ts index 2389a8abaf..c4fe385c00 100644 --- a/packages/core/src/metadata/directives.ts +++ b/packages/core/src/metadata/directives.ts @@ -678,6 +678,8 @@ export interface InputDecorator { * }) * class App {} * ``` + * + * @see [Input and Output properties](guide/template-syntax#input-and-output-properties) */ (bindingPropertyName?: string): any; new (bindingPropertyName?: string): any; @@ -721,6 +723,8 @@ export interface OutputDecorator { * * See `Input` decorator for an example of providing a binding name. * + * @see [Input and Output properties](guide/template-syntax#input-and-output-properties) + * */ (bindingPropertyName?: string): any; new (bindingPropertyName?: string): any;