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

Method _initialize

src/google-maps/map-polygon/map-polygon.ts:162–179  ·  view source on GitHub ↗
(
    map: google.maps.Map,
    polygonConstructor: typeof google.maps.Polygon,
    options: google.maps.PolygonOptions,
  )

Source from the content-addressed store, hash-verified

160 }
161
162 private _initialize(
163 map: google.maps.Map,
164 polygonConstructor: typeof google.maps.Polygon,
165 options: google.maps.PolygonOptions,
166 ) {
167 // Create the object outside the zone so its events don't trigger change detection.
168 // We'll bring it back in inside the `MapEventManager` only for the events that the
169 // user has subscribed to.
170 this._ngZone.runOutsideAngular(() => {
171 this.polygon = new polygonConstructor(options);
172 this._assertInitialized();
173 this.polygon.setMap(map);
174 this._eventManager.setTarget(this.polygon);
175 this.polygonInitialized.emit(this.polygon);
176 this._watchForOptionsChanges();
177 this._watchForPathChanges();
178 });
179 }
180
181 ngOnDestroy() {
182 this._eventManager.destroy();

Callers 1

ngOnInitMethod · 0.95

Calls 4

_assertInitializedMethod · 0.95
_watchForPathChangesMethod · 0.95
setTargetMethod · 0.80

Tested by

no test coverage detected