Press n or j to go to the next uncovered block, b, p or k for the previous block.
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | 46x 46x 46x 28x 43x | /**
* Copyright (c) Siemens 2016 - 2026
* SPDX-License-Identifier: MIT
*/
import { computed, Injectable, signal } from '@angular/core';
import { Widget } from '../model/widgets.model';
@Injectable()
export class SiGridService {
/** @defaultValue [] */
readonly widgetCatalog = signal<Widget[]>([]);
private readonly widgetCatalogMap = computed(
() => new Map(this.widgetCatalog().map(widget => [widget.id, widget]))
);
getWidget(id: string): Widget | undefined {
return this.widgetCatalogMap().get(id);
}
}
|