refactor(focus-origin-monitor): complete stream when stopping monitor (#3404)

This commit is contained in:
Kristiyan Kostadinov
2017-03-04 03:46:41 +01:00
committed by Kara
parent 63d4359fca
commit 94adecdb5e
+8 -5
View File
@@ -102,12 +102,15 @@ export class FocusOriginMonitor {
* @param element The element to stop monitoring.
*/
unmonitor(element: Element): void {
if (!this._elementInfo.has(element)) {
return;
let elementInfo = this._elementInfo.get(element);
if (elementInfo) {
elementInfo.unlisten();
elementInfo.subject.complete();
this._setClasses(element, null);
this._elementInfo.delete(element);
}
this._elementInfo.get(element).unlisten();
this._setClasses(element, null);
this._elementInfo.delete(element);
}
/**