declarativewidgets
declarativewidgets copied to clipboard
urth-core-function argument properties should declare types with polymer
For example, if a function argument is a boolean, passing in "true" should be treated as a boolean, not a string.
To test, I changed the test case in 3b to use "false" instead of "{{checked}}":
%%html
<template is="dom-bind">
<urth-core-function id="f3b" ref="aFunctionWithBoolean" arg-b="false" result="{{res}}" auto></urth-core-function>
<paper-toggle-button checked="{{checked}}"></paper-toggle-button>
<span>{{res}}</span> World
</template>
Here is a summary of the problem.
When the element initializes, there is code that reads the arg-* attributes and put their values in the args property. At this point, there is no information about the function signature, so types are unknown. Later on a signature arrives. At this point we would need to do the following:
- Check if the param in the signature has type information
- If there is a value in
argsand it is string type, then coarse the value to thetypein the signature - Set that value as the default
valueof the dynamically createdarg.*property.