@@ -18,7 +18,6 @@ import {
1818 Output ,
1919 QueryList ,
2020 TemplateRef ,
21- ViewChild ,
2221 ViewChildren
2322} from '@angular/core' ;
2423import { IgxBadgeModule } from '../badge/badge.component' ;
@@ -165,7 +164,7 @@ export class IgxBottomNavComponent implements AfterViewInit, OnDestroy {
165164 */
166165 private _navigationEndSubscription : Subscription ;
167166
168- constructor ( private _element : ElementRef , private router : Router ) {
167+ constructor ( private router : Router ) {
169168 }
170169
171170 /**
@@ -193,11 +192,11 @@ export class IgxBottomNavComponent implements AfterViewInit, OnDestroy {
193192 /**
194193 *@hidden
195194 */
196- public navigationEndHandler ( bottomNavControl : IgxBottomNavComponent ) {
197- const panelsArray = bottomNavControl . panels . toArray ( ) ;
195+ public navigationEndHandler ( bottomNavComponent : IgxBottomNavComponent ) {
196+ const panelsArray = bottomNavComponent . panels . toArray ( ) ;
198197 for ( let i = 0 ; i < panelsArray . length ; i ++ ) {
199198 if ( panelsArray [ i ] . routerLinkDirective &&
200- bottomNavControl . router . url . startsWith ( panelsArray [ i ] . routerLinkDirective . urlTree . toString ( ) ) ) {
199+ bottomNavComponent . router . url . startsWith ( panelsArray [ i ] . routerLinkDirective . urlTree . toString ( ) ) ) {
201200 panelsArray [ i ] . _selectAndEmitEvent ( ) ;
202201 break ;
203202 }
@@ -208,7 +207,9 @@ export class IgxBottomNavComponent implements AfterViewInit, OnDestroy {
208207 *@hidden
209208 */
210209 public ngOnDestroy ( ) {
211- this . _navigationEndSubscription . unsubscribe ( ) ;
210+ if ( this . _navigationEndSubscription ) {
211+ this . _navigationEndSubscription . unsubscribe ( ) ;
212+ }
212213 }
213214
214215 /**
0 commit comments