Press n or j to go to the next uncovered block, b, p or k for the previous block.
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 | 1x 1x 1x 1x | import { AfterViewInit, ChangeDetectionStrategy, Component, inject, QueryList, signal, ViewChildren } from '@angular/core';
import { AppGuidedTourService } from '../../services/guided-tour/guided-tour.service';
import { AppGuidedTourDirective } from '../guided-tour/guided-tour.directive';
import { IGuidedTourData } from '../guided-tour/guided-tour.interface';
/** An example of a guided tour. */
@Component({
selector: 'app-guided-tour-example',
templateUrl: './guided-tour-example.component.html',
styleUrls: ['./guided-tour-example.component.scss'],
providers: [AppGuidedTourService],
changeDetection: ChangeDetectionStrategy.OnPush,
standalone: false,
})
export class AppGuidedTourExampleComponent implements AfterViewInit {
public readonly tour = inject(AppGuidedTourService);
/** Tour steps. */
@ViewChildren(AppGuidedTourDirective) public steps!: QueryList<AppGuidedTourDirective>;
/** Example tour configuration. */
public tourConig$ = signal<IGuidedTourData[]>([
{
index: 0,
title: 'first',
subtitle: 'First step',
description: 'The first step. Highlighting disabled.',
first: true,
last: false,
},
{
index: 1,
title: 'second',
subtitle: 'Second step',
description: 'The second step. Highlighting enabled.',
first: false,
last: false,
},
{
index: 2,
title: 'third',
subtitle: 'Third step',
description: 'The third step. Highlighting enabled.',
first: false,
last: false,
},
{
index: 3,
title: 'fourth',
subtitle: 'Fourth step',
description: 'The fourth step. Highlighting enabled.',
first: false,
last: false,
},
{
index: 4,
title: 'fifth',
subtitle: 'Fifth step',
description: 'The fifth and the final step. Highlighting enabled.',
first: false,
last: true,
},
]);
public ngAfterViewInit(): void {
this.tour.configuration = [...this.steps];
}
}
|