diff --git a/src/jqLite.js b/src/jqLite.js index f7913ac4312f..bd53fbfbc48b 100644 --- a/src/jqLite.js +++ b/src/jqLite.js @@ -45,9 +45,9 @@ *
**Note:** All element references in AngularJS are always wrapped with jQuery or * jqLite (such as the element argument in a directive's compile / link function). They are never raw DOM references.
* - *
**Note:** Keep in mind that this function will not find elements - * by tag name / CSS selector. For lookups by tag name, try instead `angular.element(document).find(...)` - * or `$document.find()`, or use the standard DOM APIs, e.g. `document.querySelectorAll()`.
+ *
**Note:** This function will find elements + * by tag name / CSS selector and wrap it in a jQlite object, or in a jQuery object if it's available. You can also query the DOM like `angular.element(document).find(...)` + * or `$document.find()`, or use the standard DOM APIs, e.g. `document.querySelectorAll()`, without the wrapper.
* * ## AngularJS's jqLite * jqLite provides only the following jQuery methods: @@ -284,7 +284,7 @@ function JQLite(element) { } if (!(this instanceof JQLite)) { if (argIsString && element.charAt(0) !== '<') { - throw jqLiteMinErr('nosel', 'Looking up elements via selectors is not supported by jqLite! See: http://docs.angularjs.org/api/angular.element'); + return new JQLite(window.document.querySelector(element)); } return new JQLite(element); }