addEventListener
obj.addEventListener(event, handler)
Add a basic event listener to an object.
var canEvent = require("can-event");
var obj = {};
Object.assign(obj, canEvent);
obj.addEventListener("foo", function(){ ... });
Parameters
- 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.addEventListener.call(obj, event, handler)
This syntax can be used for objects that don't include the canEvent
mixin.