MCPcopy Create free account
hub / github.com/angular/components / _initialize

Method _initialize

src/google-maps/map-polyline/map-polyline.ts:160–177  ·  view source on GitHub ↗
(
    map: google.maps.Map,
    polylineConstructor: typeof google.maps.Polyline,
    options: google.maps.PolygonOptions,
  )

Source from the content-addressed store, hash-verified

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