The ng-Jq directive allows to force 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 the script which is responsible for leading the angular. Aside from ngApp directive, if you add 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 the 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.
<element [ng-jq="string"]> ... </element>
Parameters: It contains single parameter ng-jq which is optional. The name of the library must be specified under the window to use for angular.element.
- AngularJS | ng-cut Directive
- AngularJS | ng-app Directive
- AngularJS | ng-value Directive
- AngularJS | ng-src Directive
- AngularJS | ng-if Directive
- AngularJS | ng-csp Directive
- AngularJS | Directive
- AngularJS | ng-srcset Directive
- AngularJS | ng-selected Directive
- AngularJS | ng-submit Directive
- AngularJS | ng-required Directive
- AngularJS | ng-paste Directive
- AngularJS | ng-readonly Directive
- AngularJS | ng-bind Directive
- AngularJS | ng-blur Directive
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.