MCPcopy Index your code
hub / github.com/angular/components / ngOnInit

Method ngOnInit

src/google-maps/google-map/google-map.ts:300–319  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

298 }
299
300 ngOnInit() {
301 // It should be a noop during server-side rendering.
302 if (this._isBrowser) {
303 this._mapEl = this._elementRef.nativeElement.querySelector('.map-container')!;
304 this._setSize();
305
306 // Create the object outside the zone so its events don't trigger change detection.
307 // We'll bring it back in inside the `MapEventManager` only for the events that the
308 // user has subscribed to.
309 if (google.maps.Map) {
310 this._initialize(google.maps.Map);
311 } else {
312 this._ngZone.runOutsideAngular(() => {
313 google.maps
314 .importLibrary('maps')
315 .then(lib => this._initialize((lib as google.maps.MapsLibrary).Map));
316 });
317 }
318 }
319 }
320
321 private _initialize(mapConstructor: typeof google.maps.Map) {
322 this._ngZone.runOutsideAngular(() => {

Callers

nothing calls this directly

Calls 2

_setSizeMethod · 0.95
_initializeMethod · 0.95

Tested by

no test coverage detected