code: function(dom, eventName, data) {
            data = data || {};
  
            var event = document.createEvent('HTMLEvents');
  
            for (var key in data) {
              if (data.hasOwnProperty(key)) {
                event[key] = data[key];
              }
            }
  
            event.component = dom ?
              angular.element(dom).data(dom.nodeName.toLowerCase()) || null : null;
            event.initEvent(dom.nodeName.toLowerCase() + ':' + eventName, true, true);
  
            dom.dispatchEvent(event);
          }
docs: Fire a named event for a component. The view object, if it exists, is attached to event.component.
  
  @param {HTMLElement} [dom]
  @param {String} event name