ngAfterContentChecked() {
        // Clamp the next selected index to the boundsof 0 and the tabs length.
        // Note the `|| 0`, which ensures that values like NaN can't get through
        // and which would otherwise throw the component into an infinite loop
        // (since Math.max(NaN, 0) === NaN).
        let /** @type {?} */ indexToSelect = this._indexToSelect =
            Math.min(this._tabs.length - 1, Math.max(this._indexToSelect || 0, 0));
        // If there is a change in selected index, emit a change event. Should not trigger if
        // the selected index has not yet been initialized.
        if (this._selectedIndex != indexToSelect && this._selectedIndex != null) {
            const /** @type {?} */ tabChangeEvent = this._createChangeEvent(indexToSelect);
            this.selectedTabChange.emit(tabChangeEvent);
            // Emitting this value after change detection has run
            // since the checked content may contain this variable'
            Promise.resolve().then(() => this.selectedIndexChange.emit(indexToSelect));
        }
        // Setup the position for each tab and optionally setup an origin on the next selected tab.
        this._tabs.forEach((tab, index) => {
            tab.position = index - indexToSelect;
            tab.isActive = index === indexToSelect;
            // If there is already a selected tab, then set up an origin for the next selected tab
            // if it doesn't have one already.
            if (this._selectedIndex != null && tab.position == 0 && !tab.origin) {
                tab.origin = indexToSelect - this._selectedIndex;
            }
        });
        if (this._selectedIndex !== indexToSelect) {
            this._selectedIndex = indexToSelect;
            this._changeDetectorRef.markForCheck();
        }
    }
/**
     * After the content is checked, this component knows what tabs have been defined
     * and what the selected index should be. This is where we can know exactly what position
     * each tab should be in according to the new selected index, and additionally we know how
     * a new selected tab should transition in (from the left or right).
     * @return {?}
     */
After the content is checked, this component knows what tabs have been defined
and what the selected index should be. This is where we can know exactly what position
each tab should be in according to the new selected index, and additionally we know how
a new selected tab should transition in (from the left or right).
After the content is checked this component knows what tabs have been defined and what the selected index should be . This is where we can know exactly what position each tab should be in according to the new selected index and additionally we know how a new selected tab should transition in ( from the left or right ) .
ngAfterContentChecked() {
        let  indexToSelect = this._indexToSelect =
            Math.min(this._tabs.length - 1, Math.max(this._indexToSelect || 0, 0));
        if (this._selectedIndex != indexToSelect && this._selectedIndex != null) {
            const  tabChangeEvent = this._createChangeEvent(indexToSelect);
            this.selectedTabChange.emit(tabChangeEvent);
            Promise.resolve().then(() => this.selectedIndexChange.emit(indexToSelect));
        }
        this._tabs.forEach((tab, index) => {
            tab.position = index - indexToSelect;
            tab.isActive = index === indexToSelect;
            if (this._selectedIndex != null && tab.position == 0 && !tab.origin) {
                tab.origin = indexToSelect - this._selectedIndex;
            }
        });
        if (this._selectedIndex !== indexToSelect) {
            this._selectedIndex = indexToSelect;
            this._changeDetectorRef.markForCheck();
        }
    }
ngAfterContentChecked ( ) { let indexToSelect = this . _indexToSelect = Math . min ( this . _tabs . length - 1 , Math . max ( this . _indexToSelect || 0 , 0 ) ) ; if ( this . _selectedIndex != indexToSelect && this . _selectedIndex != null ) { const tabChangeEvent = this . _createChangeEvent ( indexToSelect ) ; this . selectedTabChange . emit ( tabChangeEvent ) ; Promise . resolve ( ) . then ( ( ) => this . selectedIndexChange . emit ( indexToSelect ) ) ; } this . _tabs . forEach ( ( tab , index ) => { tab . position = index - indexToSelect ; tab . isActive = index === indexToSelect ; if ( this . _selectedIndex != null && tab . position == 0 && ! tab . origin ) { tab . origin = indexToSelect - this . _selectedIndex ; } } ) ; if ( this . _selectedIndex !== indexToSelect ) { this . _selectedIndex = indexToSelect ; this . _changeDetectorRef . markForCheck ( ) ; } }
After the content is checked, this component knows what tabs have been defined
 and what the selected index should be.
After the content is checked this component knows what tabs have been defined and what the selected index should be .
// Clamp the next selected index to the boundsof 0 and the tabs length. // Note the `|| 0`, which ensures that values like NaN can't get through // and which would otherwise throw the component into an infinite loop // (since Math.max(NaN, 0) === NaN). /** @type {?} */ // If there is a change in selected index, emit a change event. Should not trigger if // the selected index has not yet been initialized. /** @type {?} */ // Emitting this value after change detection has run // since the checked content may contain this variable' // Setup the position for each tab and optionally setup an origin on the next selected tab. // If there is already a selected tab, then set up an origin for the next selected tab // if it doesn't have one already.