Browse Source

Adding comments on usage

Richard Knight 6 years ago
parent
commit
90d0a46752
1 changed files with 12 additions and 2 deletions
  1. 12 2
      src/app/dynaform/components/dynaform/dynaform.component.ts

+ 12 - 2
src/app/dynaform/components/dynaform/dynaform.component.ts

@@ -10,6 +10,16 @@ import { KeysPipe } from '@pipes/keys.pipe';
 })
 export class DynaformComponent implements OnInit {
 
+	/*
+	 * USAGE
+	 * Supply with either a FormGroup or the (string) name of a FormGroup, and the form meta data
+	 * e.g.
+	 * <app-dynaform [formGroup]="myForm" [meta]="myFormMetaData"></app-dynaform>
+	 * <app-dynaform formGroupName="myFormGroupName" [meta]="myFormMetaData"></app-dynaform>
+	 *
+	 * If supplied with just a FormGroupName it will retieve the FormGroup from the injected ControlContainer
+	 */
+
 	@Input()
 	formGroup?: FormGroup;
 
@@ -17,8 +27,8 @@ export class DynaformComponent implements OnInit {
 	formGroupName?: FormGroupName;
 
 	@Input()
-	set meta(val) {
-		this.formMetaData = val;
+	set meta(data) {
+		this.formMetaData = data;
 	}
 
 	formMetaData: any; // TODO: Tighten up type