Listens for an event on one or more subjects and calls a method on one or more targets when that event is handled.
Invoke the remote
method on the parent element every time a trigger
event is received by the window
.
<fluid-triggered-method handle="trigger" call="remote">
</fluid-triggered-method>
<fluid-triggered-method>
is available on NPM and may be installed as a dependency.
> npm install @cogizmo/fluid-triggered-method
-
Place the files on your server.
-
Install the appropriate cogizmo/Cogizmo.
- From npm
> npm install @cogizmo/cogizmo
- From github
-
Add Cogizmo to your document
<head>
.<script src="path/to/Cogizmo.js"></script>
-
Add
<fluid-triggered-method>
element to your document.<script src="path/to/fluid-triggered-method.js"></script>
-
Use element whereever you want to transclude html.
<fluid-triggered-method></fluid-triggered-method>
String<CSS Selector>
Array of element nodes to handle the event on. If omitted, <fluid-triggered-method>
will listen on the window
or global
object.
<fluid-triggered-method handle="">
</fluid-triggered-method>
String<CSS Selector>
Array of element nodes to invoke the method on when the event is handled. If omitted, <fluid-triggered-method>
will invoke the method on its parentElement
or its host
.
<fluid-triggered-method targets="">
</fluid-triggered-method>
Returns Array
- ReadOnly
An Array of element nodes that the method will be call
ed on.
<fluid-triggered-method>
is intended as a method proxy that is triggerd when events are handled. It does not currently dispatch its own events.