Skip to content

Commit 60e492e

Browse files
committed
fix links
1 parent 7378983 commit 60e492e

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,10 +102,13 @@ export class AppComponent {
102102
bday: '2018-09-09T22:00:00.000Z'
103103
}];
104104
name: 'myform',
105+
106+
// pick FormArray, FormGroup or FormControl for arrays, objects, or single values respectively
105107
control: new FormArray([])
106108
};
107109
108110
foo() {
111+
// subscribe to form value change / validation or state events
109112
this.state.control.valueChanges.subscribe(res => {
110113
console.log(res);
111114
})
@@ -147,7 +150,7 @@ This option specifies a specific input widget to be used. The default is a simpl
147150

148151
It is possible to create custom widgets using the following steps:
149152

150-
* Create a component that implements [WidgetComponent](https://github.com/dashjoin/json-schema-form/blob/master/projects/dashjoin/json-schema-form/src/lib/widget.component.ts). All relevant data such as the applicable subschema and the current value are passed to the component. Make sure to emit value changes. An example can be found [here](https://github.com/dashjoin/json-schema-form/tree/master/src/app/custom.component.ts)
153+
* Create a component that extends [BaseComponent](https://github.com/dashjoin/json-schema-form/blob/master/projects/dashjoin/json-schema-form/src/lib/base/base.component.ts). All relevant data such as the applicable subschema and the current value are passed to the component. Make sure to emit value changes via state.control. An example can be found [here](https://github.com/dashjoin/json-schema-form/blob/master/src/app/custom/custom.component.ts)
151154
* Include the component in your @NgModule declarations
152155
* In the parent component, add this service to your constructor: private service: JsonSchemaFormService
153156
* Register your widget in ngOnInit() using this service: this.service.registerComponent('rich-text-editor', CustomComponent);

0 commit comments

Comments
 (0)