Child pages
  • Provided directives, filters, services and model values

Versions Compared

Key

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

...

These directives were created with webclient behavior in mind and implementation can change  since servoy 8 is alpha.

The directives provided are:

svy-autoapply is a core directive which requires angular's 'ng-model' directive alongside it.It's responability is to listen for any change (html 'change' event) from the input element applied to  and sends the changes to the corresponding property on the server.

...

Code Block
<svy-component-wrapper component-property-value="model.childComponent2"></svy-component-wrapper>
    or
<svy-component-wrapper
     tagname="model.childComponent1.componentDirectiveName"
     name="model.childComponent1.name"
     svy-model="model.childComponent1.model"
     svy-api="model.childComponent1.api"
     svy-handlers="model.childComponent1.handlers"
     svy-servoyApi="model.childComponent1.servoyApi">
</svy-component-wrapper>

Besides these directives there are also some angular filters:

mnemonicletterFilter  - should be applied to an expression bound to an 'ng-bind-html' to underline the first letter coresponding to the filter  parameter parameter  example :

...

Code Block
ng-bind='model.myStringProperty | formatFilter:model.formatProp'

 

Services

$svyI18NService:

A component or service can ask for the $svyI18NService to get translated messages for 1 or a set of keys, it returns a promise object where the result object in the then() will be the key:value pairs of the keys that where asked for:

 

Code Block
languagejs
titleI18NService
 var x = $svyI18NService.getI18NMessages("servoy.filechooser.button.upload","servoy.filechooser.upload.addMoreFiles","servoy.filechooser.selected.files","servoy.filechooser.nothing.selected","servoy.filechooser.button.remove","servoy.filechooser.label.name","servoy.button.cancel")
    x.then(function(result) {
    	$scope.i18n_upload = result["servoy.filechooser.button.upload"];
    	$scope.i18n_chooseFiles = result["servoy.filechooser.upload.addMoreFiles"];
    	$scope.i18n_cancel = result["servoy.button.cancel"];
    	$scope.i18n_selectedFiles = result["servoy.filechooser.selected.files"];
    	$scope.i18n_nothingSelected = result["servoy.filechooser.nothing.selected"];
    	$scope.i18n_remove = result["servoy.filechooser.button.remove"];
    	$scope.i18n_name = result["servoy.filechooser.label.name"];
    })

 

Model values

Servoy provides a unique css id called svyMarkupId in the model object which can be used by the component to set its main css id to a page unique value.