Created
August 21, 2020 03:28
-
-
Save romanejaquez/eceab0c12a04d6d2d741f62817d3f51e to your computer and use it in GitHub Desktop.
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 | |
}) | |
export class StepsComponent implements OnInit { | |
steps: Observable<StepModel[]>; | |
currentStep: Observable<StepModel>; | |
constructor(private stepsService: StepsService) { } | |
ngOnInit(): void { | |
this.steps = this.stepsService.getSteps(); | |
this.currentStep = this.stepsService.getCurrentStep(); | |
} | |
onStepClick(step: StepModel) { | |
this.stepsService.setCurrentStep(step); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment