angular - Angular2 - FormGroup include and exclude replacements in RC6 -
include
, exclude
methods in formgroup
class deprecated in rc5 , removed in rc6.
so, how supposed build conditional validation? used call include/exclude form control name. addcontrol
, removecontrol
alternative?
in rc6 (and future versions) i've solved issue using abstractcontrol enable , disable methods.
example:
// before (rc5): //this.formgroup.exclude('controlname'); // after (rc6): this.formgroup.get('controlname').disable(); // before (rc5): this.formgroup.include('controlname'); // after (rc6): this.formgroup.get('controlname').enable();
hope helps you.
Comments
Post a Comment