-
Notifications
You must be signed in to change notification settings - Fork 66
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(demo): support lazy loading route (app1's user module) #55
- Loading branch information
1 parent
2e326dd
commit 4b78b78
Showing
8 changed files
with
97 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import { NgModule } from '@angular/core'; | ||
import { CommonModule } from '@angular/common'; | ||
import { RouterModule } from '@angular/router'; | ||
import { ThyLayoutModule, ThyButtonModule, ThyListModule, ThyDialogModule } from 'ngx-tethys'; | ||
import { DemoCommonModule } from '@demo/common'; | ||
import { NgxPlanetModule } from 'ngx-planet'; | ||
|
||
@NgModule({ | ||
declarations: [], | ||
imports: [ | ||
CommonModule, | ||
RouterModule, | ||
ThyLayoutModule, | ||
ThyButtonModule, | ||
ThyListModule, | ||
ThyDialogModule, | ||
DemoCommonModule, | ||
NgxPlanetModule | ||
], | ||
exports: [ | ||
CommonModule, | ||
RouterModule, | ||
ThyLayoutModule, | ||
ThyButtonModule, | ||
ThyListModule, | ||
ThyDialogModule, | ||
DemoCommonModule, | ||
NgxPlanetModule | ||
], | ||
providers: [] | ||
}) | ||
export class SharedModule {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
<p>This is user list page</p> | ||
<p>This is user list page, <code>and this module is loaded lazy.</code></p> | ||
<thy-list> | ||
<thy-list-item class="thy-list-option"><span (click)="openUserDetail(1)">Peter</span></thy-list-item> | ||
<thy-list-item class="thy-list-option"><span (click)="openUserDetail(2)">Lily</span></thy-list-item> | ||
<thy-list-item class="thy-list-option" (click)="openUserDetail(1)"><span>Peter</span></thy-list-item> | ||
<thy-list-item class="thy-list-option" (click)="openUserDetail(2)"><span>Lily</span></thy-list-item> | ||
</thy-list> | ||
|
||
<router-outlet></router-outlet> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import { NgModule } from '@angular/core'; | ||
import { CommonModule } from '@angular/common'; | ||
import { UserListComponent } from './user-list.component'; | ||
import { UserDetailComponent } from './detail/user-detail.component'; | ||
import { NgxTethysModule } from 'ngx-tethys'; | ||
import { DemoCommonModule } from '@demo/common'; | ||
import { NgxPlanetModule } from 'ngx-planet'; | ||
import { RouterModule } from '@angular/router'; | ||
import { SharedModule } from '../shared.module'; | ||
|
||
@NgModule({ | ||
declarations: [UserListComponent, UserDetailComponent], | ||
imports: [ | ||
SharedModule, | ||
RouterModule.forChild([ | ||
{ | ||
path: '', | ||
component: UserListComponent, | ||
children: [ | ||
{ | ||
path: ':id', | ||
component: UserDetailComponent | ||
} | ||
] | ||
} | ||
]) | ||
], | ||
exports: [UserListComponent, UserDetailComponent], | ||
providers: [] | ||
}) | ||
export class UserModule {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters