MCPcopy Create free account
hub / github.com/angular/examples / constructor

Method constructor

logistics-manager-app/src/app/components/map/map.ts:37–56  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

35 fleetService = inject(FleetService);
36
37 constructor() {
38 afterNextRender(() => {
39 import('leaflet').then((leaflet) => {
40 this.L = leaflet;
41 this.initMap();
42 this.updateMarkers();
43 });
44 });
45
46 effect(() => {
47 const currentVehicles = this.fleetService.units();
48 const activeUnitId = this.fleetService.activeUnitId();
49 const isDark = this.fleetService.isDarkMode();
50
51 if (!this.map || !this.L) return;
52
53 this.updateTileLayer(isDark);
54 this.updateMarkers(activeUnitId);
55 });
56 }
57
58 private updateTileLayer(isDark: boolean) {
59 if (!this.map || !this.L) return;

Callers

nothing calls this directly

Calls 3

initMapMethod · 0.95
updateMarkersMethod · 0.95
updateTileLayerMethod · 0.95

Tested by

no test coverage detected