-
Notifications
You must be signed in to change notification settings - Fork 17
FormioResource Provider
The FormioResource provider allows you to register your Form.io Resources so that all of your UI Router CRUD states will be registered for you. In almost every case, a FormioResource will be registered for any Resource you have within your Form.io project. For example, if you create a Customer Resource within your Form.io project, a new FormioResource will be registered to represent the CRUD operations for that Customer within your application.
For every resource registration, there are 5 main states that you need to be concerned with when working with the FormioResource provider.
- Index: This is the view which shows all of the submissions for a Resource within Form.io. This view by default is provided by the ngFormioGrid library.
- Create: This state is the "C" in CRUD which is used to create a new resource record (also called Submission in Form.io). This will render the form for that resource.
- Abstract: This state is used as the resource instance container for the Read, Update, and Delete states. It provides the overarching controller which loads the resource instance and provides that resource instance to all of the sub states. This is a UI Router abstract state, which means you cannot actually navigate to this state, but rather just serves as the container for the Read, Update, and Delete states within it.
- Read: This state provides the "view" of the resource submission.
- Update: This state provides the means to update the resource submission.
- Delete: This state provides the ability to delete the resource submission.
After you have created a Resource within your Form.io project, the first task will be to bring in that Resource into your application. This can be done by "registering" that resource within your application using the FormioResource.register method as follows.
FormioResource.register(name, url, options)
Name | Type | Description | ||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
name | String | The name of the resource you created and wish to represent within your application. Example: For a **Customer** resource, this would probably be 'customer' | ||||||||||||||||||||||||||||
url | String | The URL to the Resource form within Form.io. Example: https://myproject.form.io/customer | ||||||||||||||||||||||||||||
options | Object | The options for this provider as follows.
|
TO-DO
TO-DO
TO-DO
TO-DO
TO-DO
TO-DO