From d9d37590649a62b211bd079edef66bafc8b9ef51 Mon Sep 17 00:00:00 2001 From: Andre Wiggins Date: Tue, 27 Jun 2017 16:01:43 -0700 Subject: [PATCH] Extend Angular jqLite static interface --- types/angular/angular-tests.ts | 6 ++++-- types/angular/jqlite.d.ts | 3 ++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/types/angular/angular-tests.ts b/types/angular/angular-tests.ts index 6a601910d0..20de01f71f 100644 --- a/types/angular/angular-tests.ts +++ b/types/angular/angular-tests.ts @@ -627,11 +627,13 @@ function test_angular_forEach() { } // angular.element() tests -let element = angular.element('div.myApp'); +let element = angular.element('
'); let scope: ng.IScope = element.scope(); let isolateScope: ng.IScope = element.isolateScope(); -isolateScope = element.find('div.foo').isolateScope(); +isolateScope = element.find('div').isolateScope(); isolateScope = element.children().isolateScope(); +let element2 = angular.element(element); +let elementArray = angular.element(document.querySelectorAll('div')); // $timeout signature tests namespace TestTimeout { diff --git a/types/angular/jqlite.d.ts b/types/angular/jqlite.d.ts index 727e7718d7..150c50b5dd 100644 --- a/types/angular/jqlite.d.ts +++ b/types/angular/jqlite.d.ts @@ -20,6 +20,7 @@ // Dick van den Brink // Thomas Schulz // Leonard Thieu +// Andre Wiggins // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // Definitions copied from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/0480c5ec87fab41aa23047a02b27f0ea71aaf975/types/jquery/v2/index.d.ts @@ -666,7 +667,7 @@ interface JQuery { } interface JQueryStatic { - (element: string | Element | Document): JQuery; + (element: string | Element | Document | JQuery | ArrayLike): JQuery; } /**