Classes
Methods
(static) _handleEndpointRequest(method, path, bodyopt, queryopt)
Handle an endpoint request. This method finds and executes the endpoint
function that was given by a registered display item for the path
parameter.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
method |
String | Either |
|
path |
String | The path for the requested endpoint (including the display item's key) |
|
body |
object |
<optional> |
The optional body object |
query |
object |
<optional> |
The optional query for the endpoint |
- Source:
(static) addDisplayItem(displayItem)
Add a display item to the UI module.
Parameters:
Name | Type | Description |
---|---|---|
displayItem |
module:@proceed/ui.DisplayItem | The display item which has to be an instance of the DisplayItem class |
- Source:
(static) init()
Initialize the UI module. This method generates the HTML/CSS/JS needed to display the SPA with all the registered display items. It automatically checks if a window object is present (WebView environment) and directly manipulates it or it opens HTTP endpoints (other environment). It is (currently) not possible to add display items after the init() call was made.
- Source:
Type Definitions
EndpointObject
An endpoint object for specifying both a GET and a POST function for one path.
Type:
- Object
Properties:
Name | Type | Description |
---|---|---|
get |
function | The endpoint function for GET requests |
post |
function | The endpoint function for POST requests |
- Source:
Endpoints
Endpoints of a display item consisting of a path and the corresponding function (or a EndpointObject with GET and POST functions) which the UI module can provide to the SPA in order to retrieve some data.
Type:
- Object
Properties:
Name | Type | Description |
---|---|---|
{path} |
function | module:@proceed/ui.EndpointObject | {path} is the string identifying the route to this endpoint (prepended by the display item's key). The value is either a function (for only GET requests) or an EndpointObject for specifying both, a GET and a POST function for this path. |
- Source: