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

Method _initialize

src/google-maps/map-rectangle/map-rectangle.ts:169–186  ·  view source on GitHub ↗
(
    map: google.maps.Map,
    rectangleConstructor: typeof google.maps.Rectangle,
    options: google.maps.RectangleOptions,
  )

Source from the content-addressed store, hash-verified

167 }
168
169 private _initialize(
170 map: google.maps.Map,
171 rectangleConstructor: typeof google.maps.Rectangle,
172 options: google.maps.RectangleOptions,
173 ) {
174 // Create the object outside the zone so its events don't trigger change detection.
175 // We'll bring it back in inside the `MapEventManager` only for the events that the
176 // user has subscribed to.
177 this._ngZone.runOutsideAngular(() => {
178 this.rectangle = new rectangleConstructor(options);
179 this._assertInitialized();
180 this.rectangle.setMap(map);
181 this._eventManager.setTarget(this.rectangle);
182 this.rectangleInitialized.emit(this.rectangle);
183 this._watchForOptionsChanges();
184 this._watchForBoundsChanges();
185 });
186 }
187
188 ngOnDestroy() {
189 this._eventManager.destroy();

Callers 1

ngOnInitMethod · 0.95

Calls 4

_assertInitializedMethod · 0.95
setTargetMethod · 0.80

Tested by

no test coverage detected