Advertisement
Guest User

Untitled

a guest
Jul 20th, 2017
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.73 KB | None | 0 0
  1. import { Component, OnInit } from '@angular/core';
  2. import {User} from "../shared/models/user";
  3.  
  4. @Component({
  5. selector: 'app-formcomp',
  6. templateUrl: './formcomp.component.html',
  7. styleUrls: ['./formcomp.component.css'],
  8. })
  9. export class FormcompComponent implements OnInit {
  10.  
  11. private newUser = new User();
  12. private varFormToSubmit;
  13. active: boolean = true;
  14. state: string = "inactive";
  15.  
  16. constructor() {
  17. }
  18.  
  19. ngOnInit() {
  20.  
  21. }
  22.  
  23. onClickMe() {
  24. this.varFormToSubmit = this.newUser.name + ' | ' + this.newUser.username ;
  25. this.newUser = new User();// Reset the data
  26. this.active = false; // Set the form status to inactive by boolean false
  27. setTimeout( () => this.active = true, 0 );
  28. }
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement