app.component.html
{{step?.title}}
close
<mat-card-content [innerHTML]="step?.content"></mat-card-content>
<mat-card-actions align="end">
<button
mat-button
class="prev"
[disabled]="!tourService.hasPrev(step)"
(click)="tourService.prev()"
>
<mat-icon>chevron_left</mat-icon> {{step?.prevBtnTitle}}
</button>
<button
mat-button
class="next"
*ngIf="tourService.hasNext(step)"
(click)="tourService.next()"
>
{{step?.nextBtnTitle}} <mat-icon>chevron_right</mat-icon>
</button>
<button
mat-button
(click)="tourService.end()"
*ngIf="!tourService.hasNext(step)"
>
{{step?.endBtnTitle}}
</button>
</mat-card-actions>
</mat-card>
sub module component
this.tourService.initialize([{
stepId:'1',
nextStep:1,
anchorId: 'app-home',
content: 'This is a step from the eager loaded app module in the home component',
title: 'Grid Component',
enableBackdrop:true,
endBtnTitle:'End',
nextBtnTitle: "Next",
prevBtnTitle: "Prev",
closeOnOutsideClick:true,
disablePageScrolling:true,
placement:{
xPosition: 'after',
yPosition: 'above'
},
route:'sdnc/list',
},
{
stepId:'2',
nextStep:2,
prevStep:1,
anchorId: 'app-display',
content: 'This is a step from the eager loaded app module in the home component',
title: 'Records',
enableBackdrop:true,
endBtnTitle:'End',
nextBtnTitle: "Next",
prevBtnTitle: "Prev",
closeOnOutsideClick:true,
disablePageScrolling:true,
route:'sdnc/list',
},
{
stepId:'3',
nextStep:3,
prevStep:2,
anchorId: 'add-button',
content: 'This is a step from the eager loaded app module in the home component',
title: 'Add Record',
enableBackdrop:true,
endBtnTitle:'End',
nextBtnTitle: "Next",
prevBtnTitle: "Prev",
closeOnOutsideClick:true,
disablePageScrolling:true,
route:'sdnc/list',
},
]);
setTimeout(() => {
this.tourService.events$.subscribe((x) => {
// if(x?.value?.stepId==='1'){
// this.tourService.currentStep=x.value;
// }
// console.log(this.tourService.currentStep,"this.tourService.currentStep");
console.log(x,"xxxxx");
if(x.name=="stepHide" && x.value.anchorId==='add-button'){
this.addNewEntryPopup()
}
});
this.tourService.startAt(0);
}, 2000);