Skip to content

Commit e78441b

Browse files
committed
feat(ngx-material-pages): supporting lazy loading for each page
1 parent 3f9dc7f commit e78441b

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

src/module/components/ngx-material-pages/ngx-material-pages.component.html

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,14 @@
2121
</mat-toolbar>
2222
<div class="demo-sidenav-content main-container">
2323

24-
<mat-tab-group [selectedIndex]="index" style="min-height: 15vh;" class="hide-deep">
24+
<mat-tab-group [selectedIndex]="index" style="min-height: 15vh;" >
2525
<button mat-fab color="warn" (click)="previous()">
2626
<mat-icon>location</mat-icon>
2727
</button>
28-
<mat-tab *ngFor="let page of pages;let i = index;" class="test124">
29-
<ng-container [ngTemplateOutlet]="page.pageContent.content"></ng-container>
28+
<mat-tab *ngFor="let page of pages;let i = index;">
29+
<ng-template matTabContent>
30+
<ng-container [ngTemplateOutlet]="page.pageContent.content"></ng-container>
31+
</ng-template>
3032
</mat-tab>
3133
</mat-tab-group>
3234

src/module/components/ngx-material-pages/ngx-material-pages.component.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,10 @@ export class NgxMaterialPagesComponent implements OnInit, AfterContentInit {
8888
next() {
8989
this.index = this.index === this.totalPages - 1 ? this.totalPages - 1 : ++this.index;
9090
this.pageChanged.emit(this.index);
91+
92+
if (this.index === this.totalPages - 1) {
93+
this.done.emit();
94+
}
9195
}
9296

9397

@@ -97,6 +101,7 @@ export class NgxMaterialPagesComponent implements OnInit, AfterContentInit {
97101
*
98102
*/
99103
onStepSelectionChange(event: StepperSelectionEvent) {
104+
console.log('onStepSelectionChanged');
100105
this.index = event.selectedIndex;
101106
this.pageChanged.emit(this.index);
102107
}

0 commit comments

Comments
 (0)