Skip to content

Latest commit

 

History

History
35 lines (20 loc) · 1.13 KB

no-jquery-angularelement.md

File metadata and controls

35 lines (20 loc) · 1.13 KB

no-jquery-angularelement - disallow to wrap angular.element objects with jQuery or $

You should not wrap angular.element object into jQuery(), because angular.element already return jQLite element

Rule based on Angular 1.x

Examples

The following patterns are considered problems;

/*eslint angular/no-jquery-angularelement: 2*/

// invalid
$(angular.element("#id")) // error: angular.element returns already a jQLite element. No need to wrap with the jQuery object

// invalid
jQuery(angular.element("#id")) // error: angular.element returns already a jQLite element. No need to wrap with the jQuery object

The following patterns are not considered problems;

/*eslint angular/no-jquery-angularelement: 2*/

// valid
angular.element("#id")

Version

This rule was introduced in eslint-plugin-angular 0.1.0

Links