Data Events
Last updated
Was this helpful?
Last updated
Was this helpful?
The code for the following examples are available in the project inside the \data-events
folder.
In the previous example, , the binding was static. This means the information displayed inside the component does not change after its initial binding.
Often times its desired that a component react to something a user does in another component on a page. In WireBootstrap, can be used to listen for changes to data that may be of interest to a component. Using data events, component data bindings can be dynamic where the data displayed inside a component changes based on other changes on a page.
In the example below, the component sets up a data event listener for an event called my-component-change
and then rebinds to the data sent in the event when its fired on the page.