From 63842a25c32be689bdc8a12d7e1c09a03d350b51 Mon Sep 17 00:00:00 2001 From: Sean Perkins Date: Sat, 19 Mar 2022 13:10:21 -0400 Subject: [PATCH] refactor(angular): unused subscription in routerlink (#24950) --- .../directives/navigation/router-link-delegate.ts | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/angular/src/directives/navigation/router-link-delegate.ts b/angular/src/directives/navigation/router-link-delegate.ts index f09a32d3de..55c9d46411 100644 --- a/angular/src/directives/navigation/router-link-delegate.ts +++ b/angular/src/directives/navigation/router-link-delegate.ts @@ -1,17 +1,14 @@ import { LocationStrategy } from '@angular/common'; -import { ElementRef, OnChanges, OnDestroy, OnInit, Directive, HostListener, Input, Optional } from '@angular/core'; +import { ElementRef, OnChanges, OnInit, Directive, HostListener, Input, Optional } from '@angular/core'; import { Router, RouterLink } from '@angular/router'; import { AnimationBuilder, RouterDirection } from '@ionic/core'; -import { Subscription } from 'rxjs'; import { NavController } from '../../providers/nav-controller'; @Directive({ selector: '[routerLink]', }) -export class RouterLinkDelegateDirective implements OnInit, OnChanges, OnDestroy { - private subscription?: Subscription; - +export class RouterLinkDelegateDirective implements OnInit, OnChanges { @Input() routerDirection: RouterDirection = 'forward'; @@ -34,12 +31,6 @@ export class RouterLinkDelegateDirective implements OnInit, OnChanges, OnDestroy this.updateTargetUrlAndHref(); } - ngOnDestroy(): void { - if (this.subscription) { - this.subscription.unsubscribe(); - } - } - private updateTargetUrlAndHref() { if (this.routerLink?.urlTree) { const href = this.locationStrategy.prepareExternalUrl(this.router.serializeUrl(this.routerLink.urlTree));