This file contains hidden or 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
import { Injectable } from '@angular/core'; | |
import { BehaviorSubject, Observable } from 'rxjs'; | |
import { StepModel } from '../models/step.model'; | |
const STEPS = [ | |
{ stepIndex: 1, isComplete: false }, | |
{ stepIndex: 2, isComplete: false }, | |
{ stepIndex: 3, isComplete: false } | |
]; |
This file contains hidden or 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
import { Component, OnInit, ViewEncapsulation } from '@angular/core'; | |
import { StepModel } from '../../models/step.model'; | |
import { Observable } from 'rxjs'; | |
import { StepsService } from '../../services/steps.service'; | |
import { Router } from '@angular/router'; | |
@Component({ | |
selector: 'app-form-page', | |
templateUrl: './form-page.component.html', | |
styleUrls: ['./form-page.component.scss'], |
This file contains hidden or 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
<div class="form-page-container"> | |
<app-steps></app-steps> | |
<div class="step-page-container"> | |
<div class="form-step"> | |
<ng-container [ngSwitch]="(currentStep | async)?.stepIndex"> | |
<ng-container *ngSwitchCase="'1'"> | |
<app-step-template [step]="(currentStep | async)"></app-step-template> | |
</ng-container> | |
<ng-container *ngSwitchCase="'2'"> | |
<app-step-template [step]="(currentStep | async)"></app-step-template> |
This file contains hidden or 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
@import './../../../assets/colors.scss'; | |
.form-page-container { | |
display: flex; | |
flex-direction: column; | |
height: 100%; | |
width: 100%; | |
} | |
.step-page-container { |
This file contains hidden or 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
<div class="app-page-container"> | |
<router-outlet></router-outlet> | |
</div> |
This file contains hidden or 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
.app-page-container { | |
height: 100%; | |
width: 100%; | |
position: absolute; | |
top: 0; | |
bottom: 0; | |
left: 0; | |
right: 0; | |
} |
This file contains hidden or 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
<div class="complete-page"> | |
<div class="complete-page-inner"> | |
<span class="completed-page-check material-icons">check_circle</span> | |
<h2>Completed Wizard!</h2> | |
</div> | |
</div> |
This file contains hidden or 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
@import './../../../assets/colors.scss'; | |
.complete-page { | |
width: 100%; | |
height: 100%; | |
display: flex; | |
justify-content: center; | |
align-items: center; | |
} |
This file contains hidden or 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
import { Component, OnInit, ViewEncapsulation } from '@angular/core'; | |
import { StepModel } from 'src/app/models/step.model'; | |
import { StepsService } from 'src/app/services/steps.service'; | |
import { Observable } from 'rxjs'; | |
@Component({ | |
selector: 'app-steps', | |
templateUrl: './steps.component.html', | |
styleUrls: ['./steps.component.scss'], | |
encapsulation: ViewEncapsulation.None |
This file contains hidden or 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
<div class="form-steps-container"> | |
<ng-container *ngFor="let step of steps | async; let i = index;"> | |
<div (click)="onStepClick(step)" | |
[ngClass]="{ 'step-complete': step.isComplete, 'step-incomplete': !step.isComplete, 'step-current': (currentStep | async)?.stepIndex === step.stepIndex }" | |
class="step-bubble">{{ step.stepIndex }}</div> | |
<div *ngIf="i < (steps | async)?.length - 1" class="step-divider"></div> | |
</ng-container> | |
</div> |