@@ -308,12 +308,12 @@ export class NzTabSetComponent implements OnInit, AfterContentChecked, OnDestroy
308308 this . subscribeToTabLabels ( ) ;
309309 this . subscribeToAllTabChanges ( ) ;
310310
311- // Subscribe to changes in the amount of tabs, in order to be
311+ // Subscribe to changes of the number of tabs, to be
312312 // able to re-render the content as new tabs are added or removed.
313313 this . tabsSubscription = this . tabs . changes . subscribe ( ( ) => {
314314 const indexToSelect = this . clampTabIndex ( this . indexToSelect ) ;
315315
316- // Maintain the previously- selected tab if a new tab is added or removed and there is no
316+ // Maintain the previously selected tab if a new tab is added or removed, and there is no
317317 // explicit change that selects a different tab.
318318 if ( indexToSelect === this . selectedIndex ) {
319319 const tabs = this . tabs . toArray ( ) ;
@@ -338,7 +338,7 @@ export class NzTabSetComponent implements OnInit, AfterContentChecked, OnDestroy
338338 // the amount of tabs changes before the actual change detection runs.
339339 const indexToSelect = ( this . indexToSelect = this . clampTabIndex ( this . indexToSelect ) ) ;
340340
341- // If there is a change in selected index, emit a change event. Should not trigger if
341+ // If there is a change in the selected index, emit a change event. Should not trigger if
342342 // the selected index has not yet been initialized.
343343 if ( this . selectedIndex !== indexToSelect ) {
344344 const isFirstRun = this . selectedIndex == null ;
@@ -358,8 +358,8 @@ export class NzTabSetComponent implements OnInit, AfterContentChecked, OnDestroy
358358 } ) ;
359359 }
360360
361- // Setup the position for each tab and optionally setup an origin on the next selected tab.
362- this . tabs . forEach ( ( tab : NzTabComponent , index : number ) => {
361+ // Set up the position for each tab and optionally set up an origin on the next selected tab.
362+ this . tabs . forEach ( ( tab , index ) => {
363363 tab . position = index - indexToSelect ;
364364
365365 // If there is already a selected tab, then set up an origin for the next selected tab
@@ -484,7 +484,7 @@ export class NzTabSetComponent implements OnInit, AfterContentChecked, OnDestroy
484484 throw new Error ( `${ PREFIX } you should import 'RouterModule' if you want to use 'nzLinkRouter'!` ) ;
485485 }
486486 merge ( this . router . events . pipe ( filter ( e => e instanceof NavigationEnd ) ) , this . tabLinks . changes )
487- . pipe ( delay ( 0 ) , takeUntil ( this . destroy$ ) )
487+ . pipe ( startWith ( true ) , delay ( 0 ) , takeUntil ( this . destroy$ ) )
488488 . subscribe ( ( ) => {
489489 this . updateRouterActive ( ) ;
490490 this . cdr . markForCheck ( ) ;
0 commit comments