// //////////////////////////////////////////////////////////////////////// // // logout_and_redirect_to_login_page ( ) { this._dataframeAccount.logout ( ); this.nav.setRoot ( LoginComponent ).catch( () => { console.log ( "Didn't set nav root" ); } ); }
openPage ( page : PageInterface ) { console.log ( `::openPage`, page ); if ( -1 === page.id ) { this.logout_and_redirect_to_login_page ( ); } else { this.nav.setRoot ( page.component ).catch( () => { this.logout_and_redirect_to_login_page ( ); } ); } }
// //////////////////////////////////////////////////////////////////////// // // isActive ( page : any ) { // console.log ( `::isActive`, page ); let childNav = this.nav.getActiveChildNav ( ); // Tabs are a special case because they have their own navigation if ( childNav ) { if ( childNav.getSelected() && childNav.getSelected().root === page.tabComponent ) { return 'primary'; } return; } if ( this.nav.getActive() && this.nav.getActive().component === page.component ) { return 'primary'; } return; }