Skip to content

Commit

Permalink
fix(tooltip): remove tooltip component after it's parent destroyed
Browse files Browse the repository at this point in the history
  • Loading branch information
gucheen committed Oct 12, 2016
1 parent e0db8c3 commit 1649d76
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/lib/tooltip/tooltip.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,15 @@ export class MdTooltip {
this._createOverlay();
}

/**
* Remove overlay after tooltip's parent has been destroyed
*/
ngOnDestroy() {
this.visible = false;
this._overlayRef.dispose();
this._overlayRef = null;
}

/**
* Create the overlay config and position strategy
*/
Expand Down

0 comments on commit 1649d76

Please sign in to comment.