@progress/kendo-angular-gauges
Version:
Kendo UI Angular Gauges
45 lines (44 loc) • 2.18 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 { Directive } from '@angular/core';
import { ConfigurationService, CollectionChangesService } from "../services";
import * as i0 from "@angular/core";
import * as i1 from "../services";
/**
* @hidden
*/
export class CollectionComponent {
key;
configurationService;
collectionChangesService;
children;
subscription;
constructor(key, configurationService, collectionChangesService) {
this.key = key;
this.configurationService = configurationService;
this.collectionChangesService = collectionChangesService;
}
ngOnDestroy() {
this.subscription.unsubscribe();
this.configurationService.set(this.key, []);
}
ngAfterContentInit() {
this.subscription = this.children.changes.subscribe(() => this.collectionChangesService.hasChanges = true);
}
ngAfterContentChecked() {
if (this.collectionChangesService.hasChanges) {
this.configurationService.set(this.key, this.readItems());
this.collectionChangesService.hasChanges = false;
}
}
readItems() {
return this.children.map(child => Object.assign({}, child.configurationService.read()));
}
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: CollectionComponent, deps: "invalid", target: i0.ɵɵFactoryTarget.Directive });
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.2.12", type: CollectionComponent, ngImport: i0 });
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: CollectionComponent, decorators: [{
type: Directive
}], ctorParameters: function () { return [{ type: undefined }, { type: i1.ConfigurationService }, { type: i1.CollectionChangesService }]; } });