Methods
When the declarative model based on the template is not enough, you can complement it with imperative code based on Javascript functions. The Graphane component can include functions for complex algorithm, data manipulation or event handling.
You can load the method with several methods:
- with
<script type="methods"></script>
with the code embebed. - with the
methods-src
for load a resource with the Javascript functions.
In Graphane, the methods defined are accesibles from the template directives, and also be called from the property .methods
.
The method definition is sandboxed and has limited access to other functions or libraries. This restricted access ensures a secure and predictable environment for evaluating functions within the component.