This repository was archived by the owner on Mar 13, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 7 files changed +50
-5
lines changed Expand file tree Collapse file tree 7 files changed +50
-5
lines changed Original file line number Diff line number Diff line change
1
+ 10.22.1
Original file line number Diff line number Diff line change 1
1
import { NgModule } from '@angular/core' ;
2
2
import { Routes , RouterModule } from '@angular/router' ;
3
3
import { EmptyRouteComponent } from './empty-route/empty-route.component' ;
4
+ import { AuthDemoComponent } from './auth-demo/auth-demo.component' ;
5
+ import { NoSidebarDemoComponent } from './no-sidebar-demo/no-sidebar-demo.component' ;
4
6
import { APP_BASE_HREF } from '@angular/common' ;
5
7
6
8
const routes : Routes = [
7
- { path : '**' , component : EmptyRouteComponent }
9
+ { path : 'micro-frontends-angular-route/auth' , component : AuthDemoComponent } ,
10
+ { path : 'micro-frontends-angular-route/no-sidebar' , component : NoSidebarDemoComponent } ,
11
+ { path : '**' , component : EmptyRouteComponent } ,
8
12
] ;
9
13
10
14
@NgModule ( {
Original file line number Diff line number Diff line change @@ -9,7 +9,6 @@ <h1>Angular child app example</h1>
9
9
10
10
< div > < a routerLink ="/micro-frontends-react-route "> Link to React child app</ a > </ div >
11
11
12
- < tc-ex-auth-demo > </ tc-ex-auth-demo >
12
+ < router-outlet > </ router-outlet >
13
13
</ div >
14
14
15
- < router-outlet > </ router-outlet >
Original file line number Diff line number Diff line change @@ -14,8 +14,14 @@ const appMenu = [
14
14
activeIcon : angularActiveIcon ,
15
15
} ,
16
16
{
17
- title : 'Home' ,
18
- path : '/micro-frontends-angular-route/home' ,
17
+ title : 'Auth Demo' ,
18
+ path : '/micro-frontends-angular-route/auth' ,
19
+ icon : homeIcon ,
20
+ activeIcon : homeActiveIcon ,
21
+ } ,
22
+ {
23
+ title : 'No Sidebar Demo' ,
24
+ path : '/micro-frontends-angular-route/no-sidebar' ,
19
25
icon : homeIcon ,
20
26
activeIcon : homeActiveIcon ,
21
27
} ,
Original file line number Diff line number Diff line change
1
+ < h2 > No Sidebar</ h2 >
2
+ < div > Enable/disable sidebar for routes that match:</ div >
3
+ < pre > {{route}}</ pre >
4
+ < div >
5
+ < button (click) ="enable() "> Enable</ button >
6
+ < button (click) ="disable() "> Disable</ button >
7
+ </ div >
Original file line number Diff line number Diff line change
1
+ /**
2
+ * This component demonstrates how we can disable sidebar for some subroutes.
3
+ *
4
+ * For example this component disables sidebar for routes "/micro-frontends-angular-route/no-sidebar/*".
5
+ */
6
+ import { Component , OnInit } from '@angular/core' ;
7
+ import {
8
+ disableSidebarForRoute ,
9
+ enableSidebarForRoute ,
10
+ } from '@topcoder/micro-frontends-navbar-app' ;
11
+
12
+ const COMPONENT_ROUTE = "/micro-frontends-angular-route/no-sidebar/*" ;
13
+
14
+ @Component ( {
15
+ selector : 'tc-ex-no-sidebar-demo' ,
16
+ templateUrl : './no-sidebar-demo.component.html' ,
17
+ } )
18
+ export class NoSidebarDemoComponent implements OnInit {
19
+ route = COMPONENT_ROUTE
20
+ enable = ( ) => enableSidebarForRoute ( COMPONENT_ROUTE )
21
+ disable = ( ) => disableSidebarForRoute ( COMPONENT_ROUTE )
22
+
23
+ ngOnInit ( ) : void {
24
+ disableSidebarForRoute ( COMPONENT_ROUTE )
25
+ }
26
+ }
Original file line number Diff line number Diff line change @@ -4,6 +4,8 @@ declare module '@topcoder/micro-frontends-navbar-app' {
4
4
export const setAppMenu : any ;
5
5
export const getAuthUserTokens : any ;
6
6
export const getAuthUserProfile : any ;
7
+ export const disableSidebarForRoute : any ;
8
+ export const enableSidebarForRoute : any ;
7
9
}
8
10
9
11
declare module "*.svg" {
You can’t perform that action at this time.
0 commit comments