AngularJS ng-jq Directive Last Updated : 12 Jul, 2025 Comments Improve Suggest changes 3 Likes Like Report The ng-Jq directive in AngularJS allows forcing the library used by angular.element library. The forcing of jQLite should happen when we leave ng-jq blank, otherwise set the name of the jquery variable under the window (e.g., jQuery). jQLite is directly built into AngularJS and is an important subset of jQuery. By default, AngularJS use jQLite. This directive is looked upon by the AngularJS when it needs to get loaded, and it does not wait for the DOMContentLoaded event at all. It should get placed on the element which comes up before going to the script which is responsible for leading the angular. Aside from the ng-app directive, if you add the ng-jq directive, you can specify the jQuery name which will be available under the window, which is going to be extremely crucial when you are going to use jQuery with an alias variable. Note: Only the first instance of the ng-jq directive is going to be used by the AngularJS, while all the others will get ignored. Use jQuery to load the jQuery library before loading the AngularJS then angular will skip jQLite and it will start to use the jQuery library. Syntax: The ng-jq Directive can be used: As an element: <ng-jq [ng-jq="string"]> Content... </ng-jq>As an attribute: <element [ng-jq="string"]> Content... </element>Parameter value: It contains a single parameter ng-jq which is optional. The name of the library must be specified under the window to use for the angular.element. Example: This example describes the use of the ng-jq Directive in AngularJS, by checking the existence of jQuery. HTML <!DOCTYPE html> <html> <head> <title>AngularJS ng-jq Directive</title> <script data-require="[email protected]" data-semver="2.1.3" src="http://code.jquery.com/jquery-2.1.3.js"> </script> <script> var jQuery_2_1_3 = $.noConflict(true); </script> <script data-require="[email protected]" data-semver="1.4.0-rc.0" src="https://code.angularjs.org/1.4.0-rc.0/angular.js"> </script> <script> angular.module('ngAppTest', []) .controller('MainCtrl', function () { this.isUsingJQuery = angular.element.toString() .indexOf('jQuery') !== -1; }) </script> </head> <body style="text-align:center;" ng-app="ngAppTest" ng-jq="jQuery_2_1_3" ng-controller="MainCtrl as vm"> <h1 style="color:green">GeeksforGeeks</h1> <h3 style="color:purple">ng-jq Directive</h3> <p>is using jQuery : {{ vm.isUsingJQuery }}</p> </body> </html> Output: Create Quiz Comment S SohomPramanick Follow 3 Improve S SohomPramanick Follow 3 Improve Article Tags : Web Technologies AngularJS AngularJS-Directives Explore AngularJS BasicsAngularJS Tutorial 5 min read Introduction to AngularJS 4 min read Angular CLI | Angular Project Setup 3 min read AngularJS Expressions 2 min read AngularJS Modules 3 min read AngularJS ng-model Directive 4 min read AngularJS Data Binding 4 min read AngularJS Controllers 3 min read AngularJS | Scope 2 min read AngularJS Services 4 min read AngularJS | AJAX - $http 3 min read AngularJS | Tables 2 min read AngularJS Select Boxes 2 min read AngularJS SQL 3 min read AngularJS HTML DOM 2 min read AngularJS Events 3 min read AngularJS | Forms 3 min read AngularJS Form Validation 3 min read AngularJS | API 2 min read AngularJS and W3.CSS 2 min read AngularJS Includes 3 min read AngularJS Animations 1 min read AngularJS | Application 3 min read AngularJS DirectivesAngularJS Directives 9 min read AngularJS ng-app Directive 1 min read AngularJS ng-bind Directive 2 min read AngularJS ng-bind-html Directive 2 min read AngularJS ng-bind-template Directive 2 min read AngularJS ng-blur Directive 1 min read AngularJS ng-change Directive 2 min read AngularJS ng-checked Directive 2 min read AngularJS ng-class Directive 2 min read AngularJS ng-class-even Directive 2 min read AngularJS ng-class-odd Directive 2 min read AngularJS ng-click Directive 2 min read AngularJS ng-cloak Directive 2 min read AngularJS ng-controller Directive 2 min read AngularJS Directives Complete Reference 2 min read AngularJS FiltersAngularJS | Filters 7 min read AngularJS currency Filter 2 min read AngularJS | date Filter 2 min read AngularJS filter Filter 3 min read AngularJS json Filter 2 min read AngularJS limitTo Filter 2 min read AngularJS lowercase Filter 1 min read AngularJS number Filter 1 min read AngularJS orderBy Filter 4 min read AngularJs uppercase Filter 1 min read AngularJS Converting FunctionsAngularJS angular.lowercase() Function 2 min read AngularJS angular.uppercase() Function 1 min read AngularJS angular.forEach() Function 1 min read AngularJS Comparing FunctionsAngularJS angular.isArray() Function 2 min read AngularJS angular.isDate() Function 2 min read AngularJS angular.isDefined() Function 2 min read AngularJS angular.isElement() Function 2 min read AngularJS angular.isFunction() Function 2 min read AngularJS angular.isNumber() Function 2 min read AngularJS angular.isObject() Function 2 min read AngularJS | angular.isString() Function 1 min read AngularJS angular.isUndefined() Function 2 min read AngularJS angular.equals() Function 2 min read AngularJS angular.toJson() Function 2 min read AngularJS QuestionsHow to bundle an Angular app for production? 4 min read How to add many functions in one ng-click directive? 2 min read How to directly update a field by using ng-click in AngularJS ? 3 min read How to Add Dynamic Options for Multiple Selects Inside ng-repeat Directive ? 3 min read How to detect when an @Input() value changes in Angular? 3 min read How to open popup using Angular and Bootstrap ? 2 min read How to reload or re-render the entire page using AngularJS? 2 min read How to add input fields dynamically on button click in AngularJS ? 2 min read How to Create Button Dynamically with Click Event in Angular ? 2 min read How to use jQuery in Angular ? 2 min read AngularJS Examples 2 min read Like