Child pages
  • Angular services

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Services are similar to WebComponents except they have no User Interfaceuser interface. They are mapped to Servoy plugins (scope in order to call their api from scripting). Inside war structure, NG Client Services .

A service must contain the specification file and the js file. The service specification file is exactly the same as web component specification file. However, as there is no UI, there is no support for handlers.

Services implementations have to be present in special folders whose names end with "services" suffix (for example default servoy services are found into "servoyservices" directory). A folder that doesn't end with "services" will be handled as web component webcomponent folder.

The difference between service and web component is that service doesn't have user interface (so also doesn't have html template). A service must contain the specification file and the js file. The service specification file is exactly the same as web component specification file. However, as there is no UI, there is no support for handlers. Service API can be called from scripting as a plugin.An example service:

Code Block
titletestservice.spec
{
	"name": "testservice",
	"displayName": "Test service that says helloworld",
	"definition": "servoyservices/testservice/testservice.js",
	"libraries": [],
	"model":
	{
		"text": "string"
	},
	"api":
	{
	 	"talk": {
	        }
	}
}

...