@progress/kendo-angular-treelist
Version:
Kendo UI TreeList for Angular - Display hierarchical data in an Angular tree grid view that supports sorting, filtering, paging, and much more.
31 lines (30 loc) • 1.5 kB
JavaScript
/**-----------------------------------------------------------------------------------------
* Copyright © 2025 Progress Software Corporation. All rights reserved.
* Licensed under commercial license. See LICENSE.md in the project root for more information
*-------------------------------------------------------------------------------------------*/
import { EventEmitter, NgZone, Injectable } from '@angular/core';
import { take } from 'rxjs/operators';
import * as i0 from "@angular/core";
/**
* @hidden
*/
export class ChangeNotificationService {
ngZone;
changes = new EventEmitter();
subscription;
constructor(ngZone) {
this.ngZone = ngZone;
}
notify() {
if (!this.subscription || this.subscription.closed) {
this.subscription = this.ngZone.onStable
.asObservable().pipe(take(1))
.subscribe(() => this.changes.emit());
}
}
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: ChangeNotificationService, deps: [{ token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Injectable });
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: ChangeNotificationService });
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: ChangeNotificationService, decorators: [{
type: Injectable
}], ctorParameters: () => [{ type: i0.NgZone }] });