Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

Getting PointerEvent instead of jQuery.Event on ng-click in AngularJS

function bindJQuery() {
    // ...
  
    // bind to jQuery if present;
    var jqName = jq();
    jQuery = isUndefined(jqName) ? window.jQuery :   // use jQuery (if present)
             !jqName             ? undefined     :   // use jqLite
                                   window[jqName];   // use jQuery specified by `ngJq`
  
    // Use jQuery if it exists with proper functionality, otherwise default to us.
    // AngularJS 1.2+ requires jQuery 1.7+ for on()/off() support.
    // AngularJS 1.3+ technically requires at least jQuery 2.1+ but it may work with older
    // versions. It will not work for sure with jQuery <1.7, though.
    if (jQuery && jQuery.fn.on) {
      jqLite = jQuery;
      extend(jQuery.fn, {
        scope: JQLitePrototype.scope,
        isolateScope: JQLitePrototype.isolateScope,
        controller: /** @type {?} */ (JQLitePrototype).controller,
        injector: JQLitePrototype.injector,
        inheritedData: JQLitePrototype.inheritedData
      });
    } else {
      jqLite = JQLite;
    }
  
    // ...
  }
 
PREVIOUS NEXT
Tagged: #Getting #PointerEvent #AngularJS
ADD COMMENT
Topic
Name
9+7 =