title: ExtJS 6.x Add Custom Click Event To Component For ViewController
body: <p>For ExtJS 6.5+ Modern, how do you add a click event to an component so that you can access it in a view controller.</p>
  
  <p>The example below doesn't work.  I have also tried adding a listener directly to the sub-element. </p>
  
  <p>Example Template:</p>
  
  <pre><code>Ext.define('TestController', {
      extend: 'Ext.app.ViewController',
      alias: 'controller.test-controller',
  
      control: {
          '[reference=someComponent]': {
              click: 'someComponentClick'
          }
      },
  
      someComponentClick: function() { 
         console.log('it worked!')
      }
  })
  
  
  Ext.define('TestContainer', {
      extend: 'Ext.Container',
      xtype: 'test-container',
      controller: 'test-controller',
      items: [
          {
              xtype: 'component',
              reference: 'someComponent'
              html: 'CLICK HERE TO TEST'
          }
      ]
  })
  </code></pre>
  
  <p><strong>Update</strong></p>
  
  <p>Based on priyadarshi answer, the following on the element calls the function in the controller.  I would prefer however to pick the event up normally in the controller by just listening to the click event.   Is there anyway to attach event listeners to the dom from the controller or at least fire an event from the element so that you can pick it up in the controller (without it explicitly calling functions on the controller).</p>
  
  <pre><code> Ext.define('TestController', {
       extend: 'Ext.app.ViewController',
       alias: 'controller.test-controller',
  
       control: {
           '[reference=someComponent]': {
               click: 'someComponentClick'
           }
       },
  
       someComponentClick: function() { 
          console.log('it worked!')
       },
       someFuncOnController: function() {
           console.log('someFuncOnController') // &lt;&lt; This runs
       }
   })
  
  
   Ext.define('TestContainer', {
       extend: 'Ext.Container',
       xtype: 'test-container',
       controller: 'test-controller',
       items: [
           {
               xtype: 'component',
               reference: 'someComponent'
               html: 'CLICK HERE TO TEST',
               listeners: [
                   element: 'element',
                   click: 'someFuncOnController'
               ]
           }
       ]
   })
  </code></pre>