GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Docs
  • Tutorials
  • Playground
  • Reference
  • code
  • output
  • OutputRef#subscribe
  • Custom events with outputs
  • OutputEmitterRef

This view

  • Original page
  • New address

GeezerVison is showing angular.dev — output • Angular

API

    
      
    
    
@paramoptsOutputOptions | undefined
@returnsOutputEmitterRef<T>
Usage notes

To use output(), import the function from @angular/core.

import {output} from '@angular/core';

Inside your component, introduce a new class member and initialize it with a call to output.

@Directive({
  ...
})
export class MyDir {
  nameChange = output<string>();    // OutputEmitterRef<string>
  onClick    = output();            // OutputEmitterRef<void>
}

You can emit values to consumers of your directive, by using the emit method from OutputEmitterRef.

updateName(newName: string): void {
  this.nameChange.emit(newName);
}

Usage Notes

To use output(), import the function from @angular/core.

import {output} from '@angular/core';

Inside your component, introduce a new class member and initialize it with a call to output.

@Directive({
  ...
})
export class MyDir {
  nameChange = output<string>();    // OutputEmitterRef<string>
  onClick    = output();            // OutputEmitterRef<void>
}

You can emit values to consumers of your directive, by using the emit method from OutputEmitterRef.

updateName(newName: string): void {
  this.nameChange.emit(newName);
}
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.