import { Component, Output, EventEmitter } from '@angular/core'; @Component({ selector: 'storybook-form', template: `

Completed!!

`, }) export default class FormComponent { /** * Optional success handler */ @Output() onSuccess = new EventEmitter(); value = ''; complete = false; handleSubmit(event: SubmitEvent) { event.preventDefault(); this.onSuccess.emit(this.value); setTimeout(() => { this.complete = true; }, 500); setTimeout(() => { this.complete = false; }, 1500); } }