diff --git a/nativescript-angular/router/ns-router-link-active.ts b/nativescript-angular/router/ns-router-link-active.ts index 75c1fe855..e9a2fa504 100644 --- a/nativescript-angular/router/ns-router-link-active.ts +++ b/nativescript-angular/router/ns-router-link-active.ts @@ -106,9 +106,9 @@ export class NSRouterLinkActive implements OnChanges, OnDestroy, AfterContentIni const isActiveLinks = this.reduceList(currentUrlTree, this.links); this.classes.forEach((c) => { if (isActiveLinks) { - this.renderer.removeClass(this.element.nativeElement, c); - } else { this.renderer.addClass(this.element.nativeElement, c); + } else { + this.renderer.removeClass(this.element.nativeElement, c); } }); }