### File

`src/lib/sign-out.directive.ts`

### Metadata

Selector | `[rxapSignOut]`
Standalone | `true`

### Index

###### Methods
Public Async onClick
###### Outputs
failure successful
###### HostListeners
click

### Constructor

`constructor(auth: RxapAuthenticationService)`
Defined in src/lib/sign-out.directive.ts:19
Parameters :
Name | Type | Optional
auth | `RxapAuthenticationService` | No

### Outputs

failure
Type : `EventEmitter`
Defined in src/lib/sign-out.directive.ts:19

successful
Type : `EventEmitter`
Defined in src/lib/sign-out.directive.ts:16

### HostListeners

click
Defined in src/lib/sign-out.directive.ts:25

### Methods

Public Async onClick
`onClick()`
Decorators : `@HostListener('click')`
Defined in src/lib/sign-out.directive.ts:25
Returns : `any`

    import {
      Directive,
      EventEmitter,
      HostListener,
      Output,
    } from '@angular/core';
    import { RxapAuthenticationService } from './authentication.service';

    @Directive({
      selector: '[rxapSignOut]',
      standalone: true,
    })
    export class SignOutDirective {

      @Output()
      public successful = new EventEmitter<void>();

      @Output()
      public failure = new EventEmitter<Error>();

      constructor(private readonly auth: RxapAuthenticationService) {
      }

      @HostListener('click')
      public async onClick() {
        try {
          await this.auth.signOut();
          this.successful.emit();
        } catch (e: any) {
          this.failure.emit(e);
        }
      }

    }

# results matching ""

# No results matching ""