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

Method setTarget

src/google-maps/map-event-manager.ts:100–118  ·  view source on GitHub ↗

Sets the current target that the manager should bind events to.

(target: MapEventManagerTarget)

Source from the content-addressed store, hash-verified

98
99 /** Sets the current target that the manager should bind events to. */
100 setTarget(target: MapEventManagerTarget) {
101 const currentTarget = this._targetStream.value;
102
103 if (target === currentTarget) {
104 return;
105 }
106
107 // Clear the listeners from the pre-existing target.
108 if (currentTarget) {
109 this._clearListeners();
110 this._pending = [];
111 }
112
113 this._targetStream.next(target);
114
115 // Add the listeners that were bound before the map was initialized.
116 this._pending.forEach(subscriber => subscriber.observable.subscribe(subscriber.observer));
117 this._pending = [];
118 }
119
120 /** Destroys the manager and clears the event listeners. */
121 destroy() {

Callers 14

_initializeMethod · 0.80
ngOnInitMethod · 0.80
_initializeMethod · 0.80
ngOnInitMethod · 0.80
_initializeMethod · 0.80
_initializeMethod · 0.80
_initializeMethod · 0.80
_initializeMethod · 0.80
_initializeMethod · 0.80
_initializeMethod · 0.80
_initializeMethod · 0.80

Calls 2

_clearListenersMethod · 0.95
nextMethod · 0.45

Tested by

no test coverage detected