-
Notifications
You must be signed in to change notification settings - Fork 137
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
travis
committed
Jan 8, 2016
1 parent
e311386
commit f8865b0
Showing
2 changed files
with
27 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
'use strict'; | ||
var Utils = (function () { | ||
function Utils() { | ||
} | ||
// bit of a hack here to reset the validation / state on the control as well as the value | ||
// expecting a Control.reset() method to do this but there doesn't seem to be one | ||
// http://stackoverflow.com/questions/33084280/how-to-reset-control-value | ||
Utils.resetControl = function (control) { | ||
control['updateValue'](''); | ||
control['_touched'] = false; | ||
control['_untouched'] = true; | ||
control['_pristine'] = true; | ||
control['_dirty'] = false; | ||
return control; | ||
}; | ||
return Utils; | ||
})(); | ||
exports.Utils = Utils; |