import { Component , OnInit } from '@angular/core' ; @ Component ( { selector : 'thy-form-basic-example' , templateUrl : './basic.component.html' } ) export class ThyFormBasicExampleComponent implements OnInit { model = { name : '' , password : '' } ; saving = false ; constructor ( ) { } ngOnInit ( ) { } login ( ) { if ( this . saving ) { return ; } this . saving = true ; setTimeout ( ( ) => { this . saving = false ; } , 2000 ) ; } cancel ( ) { this . model = { name : '' , password : '' } ; } }