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

Method ngOnChanges

src/google-maps/google-map/google-map.ts:277–302  ·  view source on GitHub ↗
(changes: SimpleChanges<this>)

Source from the content-addressed store, hash-verified

275 }
276
277 ngOnChanges(changes: SimpleChanges<this>) {
278 if (changes['height'] || changes['width']) {
279 this._setSize();
280 }
281
282 const googleMap = this.googleMap;
283
284 if (googleMap) {
285 if (changes['options']) {
286 googleMap.setOptions(this._combineOptions());
287 }
288
289 if (changes['center'] && this._center) {
290 googleMap.setCenter(this._center);
291 }
292
293 // Note that the zoom can be zero.
294 if (changes['zoom'] && this._zoom != null) {
295 googleMap.setZoom(this._zoom);
296 }
297
298 if (changes['mapTypeId'] && this.mapTypeId) {
299 googleMap.setMapTypeId(this.mapTypeId);
300 }
301 }
302 }
303
304 ngOnInit() {
305 // It should be a noop during server-side rendering.

Callers

nothing calls this directly

Calls 2

_setSizeMethod · 0.95
_combineOptionsMethod · 0.95

Tested by

no test coverage detected