daily pastebin goal
10%
SHARE
TWEET

Untitled

a guest May 11th, 2018 88 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import { Component, OnInit, Input }   from '@angular/core';
  2.  
  3. import { FormData }                   from '../data/formData.model';
  4. import { FormDataService }            from '../data/formData.service';
  5.  
  6. @Component ({
  7.  
  8. })
  9.  
  10. export class ResultComponent implements OnInit {
  11.     title = 'Thanks for staying tuned!';
  12.     @Input() formData: FormData;
  13.     isFormValid: boolean = false;
  14.    
  15.     constructor(private formDataService: FormDataService) {
  16.     }
  17.  
  18.     ngOnInit() {
  19.         this.formData = this.formDataService.getFormData();
  20.         this.isFormValid = this.formDataService.isFormValid();
  21.         console.log('Result feature loaded!');
  22.     }
  23.  
  24.     submit() {
  25.         alert('Excellent Job!');
  26.         this.formData = this.formDataService.resetFormData();
  27.         this.isFormValid = false;
  28.     }
  29. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top