delegate
obj.delegate(selector, event, handler)
Provides a compatibility layer for adding delegate event listeners. This doesn't actually implement delegates, but rather allows logic that assumes a delegate to still function.
Therefore, this is essentially an alias of addEventListener with the selector ignored.
Parameters
- selector
{String}
:The ignored selector to use for the delegate.
- event
{String}
:The name of the event to listen for.
- handler
{function}
:The handler that will be executed to handle the event.
Returns
{Object}
:
this
canEvent.delegate.call(obj, selector, event, handler)
This syntax can be used for objects that don't include the [can.event] mixin.