@@ -18,7 +18,6 @@ import {
18
18
Output ,
19
19
QueryList ,
20
20
TemplateRef ,
21
- ViewChild ,
22
21
ViewChildren
23
22
} from '@angular/core' ;
24
23
import { IgxBadgeModule } from '../badge/badge.component' ;
@@ -165,7 +164,7 @@ export class IgxBottomNavComponent implements AfterViewInit, OnDestroy {
165
164
*/
166
165
private _navigationEndSubscription : Subscription ;
167
166
168
- constructor ( private _element : ElementRef , private router : Router ) {
167
+ constructor ( private router : Router ) {
169
168
}
170
169
171
170
/**
@@ -193,11 +192,11 @@ export class IgxBottomNavComponent implements AfterViewInit, OnDestroy {
193
192
/**
194
193
*@hidden
195
194
*/
196
- public navigationEndHandler ( bottomNavControl : IgxBottomNavComponent ) {
197
- const panelsArray = bottomNavControl . panels . toArray ( ) ;
195
+ public navigationEndHandler ( bottomNavComponent : IgxBottomNavComponent ) {
196
+ const panelsArray = bottomNavComponent . panels . toArray ( ) ;
198
197
for ( let i = 0 ; i < panelsArray . length ; i ++ ) {
199
198
if ( panelsArray [ i ] . routerLinkDirective &&
200
- bottomNavControl . router . url . startsWith ( panelsArray [ i ] . routerLinkDirective . urlTree . toString ( ) ) ) {
199
+ bottomNavComponent . router . url . startsWith ( panelsArray [ i ] . routerLinkDirective . urlTree . toString ( ) ) ) {
201
200
panelsArray [ i ] . _selectAndEmitEvent ( ) ;
202
201
break ;
203
202
}
@@ -208,7 +207,9 @@ export class IgxBottomNavComponent implements AfterViewInit, OnDestroy {
208
207
*@hidden
209
208
*/
210
209
public ngOnDestroy ( ) {
211
- this . _navigationEndSubscription . unsubscribe ( ) ;
210
+ if ( this . _navigationEndSubscription ) {
211
+ this . _navigationEndSubscription . unsubscribe ( ) ;
212
+ }
212
213
}
213
214
214
215
/**
0 commit comments