MCPcopy
hub / github.com/angular/components / ngOnInit

Method ngOnInit

src/google-maps/map-marker/map-marker.ts:285–301  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

283 marker?: google.maps.Marker;
284
285 ngOnInit() {
286 if (!this._googleMap._isBrowser) {
287 return;
288 }
289
290 if (google.maps.Marker && this._googleMap.googleMap) {
291 this._initialize(this._googleMap.googleMap, google.maps.Marker);
292 } else {
293 this._ngZone.runOutsideAngular(() => {
294 Promise.all([this._googleMap._resolveMap(), google.maps.importLibrary('marker')]).then(
295 ([map, lib]) => {
296 this._initialize(map, (lib as google.maps.MarkerLibrary).Marker);
297 },
298 );
299 });
300 }
301 }
302
303 private _initialize(map: google.maps.Map, markerConstructor: typeof google.maps.Marker) {
304 // Create the object outside the zone so its events don't trigger change detection.

Callers

nothing calls this directly

Calls 2

_initializeMethod · 0.95
_resolveMapMethod · 0.80

Tested by

no test coverage detected