### File

`projects/angular-l10n/src/lib/models/l10n-async-pipe.ts`

### Index

###### Properties

- Protected onChanges

###### Methods

- ngOnDestroy

### Constructor

`constructor(translation: L10nTranslationService, cdr: ChangeDetectorRef)`
Defined in projects/angular-l10n/src/lib/models/l10n-async-pipe.ts:9

Parameters :

Name | Type | Optional
translation | `L10nTranslationService` | No
cdr | `ChangeDetectorRef` | No

### Methods

ngOnDestroy
`ngOnDestroy()`
Defined in projects/angular-l10n/src/lib/models/l10n-async-pipe.ts:17
Returns : `void`

### Properties

Protected onChanges
Type : `Subscription`
Defined in projects/angular-l10n/src/lib/models/l10n-async-pipe.ts:9

    import { Injectable, OnDestroy, ChangeDetectorRef } from '@angular/core';
    import { Subscription } from 'rxjs';

    import { L10nTranslationService } from '../services/l10n-translation.service';

    @Injectable()
    export class L10nAsyncPipe implements OnDestroy {

        protected onChanges: Subscription;

        constructor(protected translation: L10nTranslationService, protected cdr: ChangeDetectorRef) {
            this.onChanges = this.translation.onChange().subscribe({
                next: () => this.cdr.markForCheck()
            });
        }

        ngOnDestroy() {
            if (this.onChanges) this.onChanges.unsubscribe();
        }

    }

# result-matching ""

# No results matching ""