1) I want to call a Servoy form function from a component
2) I want to pass a variable or call a function within a service
In various posts I have seen things like "svyServoyapi" are these items built in and if so is there a list anywhere as I have thus far hit the wall on finding anything in the wiki.
I guess the fundamental problem is my understanding of the concept of NG Client and components is not yet at a point the wiki is making any sense. Ironically I can do all of this is raw angular which rather defeats the object of Servoy sadly
help much appreciated
I have a simple button component that outputs a message to the console - so this function works
html:
- Code: Select all
<div><button class="btn btn-info" ng-click="onClick($event)">test</button></div>
Spec:
- Code: Select all
{
"name": "gordon-test-Button",
"displayName": "testButton",
"version": 1,
"definition": "gordon/testButton/testButton.js",
"libraries": [],
"model":
{
"yourName" : {"type": "string", "default":"World"}
}
}
JS File:
- Code: Select all
angular.module('gordonTestButton',['servoy']).directive('gordonTestButton', function() {
return {
restrict: 'E',
scope: {
model: '=svyModel',
handlers: "=svyHandlers",
api: "=svyApi",
svyServoyapi: "="
},
controller: function($scope, $element, $attrs) {
},
link: function (scope, element, attrs) {
scope.onClick= function (event) {
console.log('Button clicked')
//scope.svyServoyapi.apply('dataProviderID');
};
},
templateUrl: 'gordon/testButton/testButton.html'
};
})