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

Popular posts from this blog

java - Jasper subreport showing only one entry from the JSON data source when embedded in the Title band -

serialization - Convert Any type in scala to Array[Byte] and back -

SonarQube Plugin for Jenkins does not find SonarQube Scanner executable -