Service Development
A Servoy service is a plain Angular service with the @Injectable() annotation
It should just be correctly configured in the manifest and also in the specfile.
The spec file should container stuff like:
the packageName should be the same as in the manifest:
and the serviceName should be the same as the name of the class:
also the module name is needed so that your service can include everything it needs in its module:
The entry point is just for servoy to know where the distribution (build output of the angular compiler) is in the package.
After that the model properties are just public fiels of the service and api are just public functions.
If it is needed that you want todo something when a property is changed you can just get/set in typescript:
this sample does call restoreOnIdleState() when the onIdle model property is set.
Last updated