ic-transform-response- Transform Response attribute
This attribute may be placed on parent elements, allowing you to specify behavior across multiple elements.
Available symbols are:
content- The string content of the server response
url- The URL that the content came from
elt- The element that triggered the request
ic-transform-response attribute can be placed on an parent element, allowing general request processing
for an entire page. Intercooler will find the closest element with this attribute and evaluate it.
Note that, due to the way intercooler evaluates expressions, you must include a
return statement in this attribute to return the value.
Here is a simple example, using a poll interval to update a list coming from a JSON end point and
to convert that JSON into HTML:
<ul ic-get-from="/ips" ic-poll="1s" ic-transform-response="return jsonToHTML(content)"> <li>No Data Yet...</li> </ul>