Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import { Component, OnInit } from '@angular/core';
- import {User} from "../shared/models/user";
- @Component({
- selector: 'app-formcomp',
- templateUrl: './formcomp.component.html',
- styleUrls: ['./formcomp.component.css'],
- })
- export class FormcompComponent implements OnInit {
- private newUser = new User();
- private varFormToSubmit;
- active: boolean = true;
- state: string = "inactive";
- constructor() {
- }
- ngOnInit() {
- }
- onClickMe() {
- this.varFormToSubmit = this.newUser.name + ' | ' + this.newUser.username ;
- this.newUser = new User();// Reset the data
- this.active = false; // Set the form status to inactive by boolean false
- setTimeout( () => this.active = true, 0 );
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement