From cc5c0a5fed154e7dcbba60e1c40a8deb872c5338 Mon Sep 17 00:00:00 2001 From: Stephen Hazleton Date: Fri, 19 Feb 2016 01:10:49 +1300 Subject: [PATCH] using setErrors isntead of the hacks --- app/services/utils.ts | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/app/services/utils.ts b/app/services/utils.ts index 6e87e88..c560d96 100644 --- a/app/services/utils.ts +++ b/app/services/utils.ts @@ -15,10 +15,7 @@ export class Utils { // http://stackoverflow.com/questions/33084280/how-to-reset-control-value public static resetControl(control: AbstractControl): AbstractControl { control['updateValue'](''); - control['_touched'] = false; - control['_untouched'] = true; - control['_pristine'] = true; - control['_dirty'] = false; + control.setErrors(null); return control; } }