From c6f0355c0734d16e02fa0a9c42a434940a9cc929 Mon Sep 17 00:00:00 2001 From: Dona278 Date: Fri, 9 Feb 2018 11:07:49 +0100 Subject: [PATCH 1/2] Added IStickyService Docs: https://material.angularjs.org/latest/api/service/$mdSticky --- types/angular-material/angular-material-tests.ts | 11 +++++++++-- types/angular-material/index.d.ts | 5 +++++ 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/types/angular-material/angular-material-tests.ts b/types/angular-material/angular-material-tests.ts index 8d6955c697..06d98505ed 100644 --- a/types/angular-material/angular-material-tests.ts +++ b/types/angular-material/angular-material-tests.ts @@ -164,8 +164,7 @@ myApp.controller('DialogController', ($scope: TestScope, $mdDialog: ng.material. .controller(function TestController(param) { }) .controller(class { }) .controller(['fakeService', function TestController(fake) { }]) - .controller(['fakeService', class { }]) - ; + .controller(['fakeService', class { }]); const dialogOptions: ng.material.IDialogOptions = {}; @@ -389,3 +388,11 @@ myApp.controller('PanelController', ($scope: TestScope, $mdPanel: ng.material.IP $mdPanel.newPanelAnimation().openFrom({ top: 0, left: 0 }); }; }); + +myApp.controller('StickyController', ($scope: TestScope, $mdSticky: ng.material.IStickyService) => { + const stickyElement = angular.element(new Element()); + const cloneStickyElement = stickyElement.clone(); + + $mdSticky($scope, stickyElement); + $mdSticky($scope, stickyElement, cloneStickyElement); +}); \ No newline at end of file diff --git a/types/angular-material/index.d.ts b/types/angular-material/index.d.ts index 92f6d46751..e9263459f1 100644 --- a/types/angular-material/index.d.ts +++ b/types/angular-material/index.d.ts @@ -494,5 +494,10 @@ declare module 'angular' { interface IProgressCircularProvider { configure(options: IProgressCircularConfig): void; } + + interface IStickyService { + (scope: IScope, element: JQuery): void; + (scope: IScope, element: JQuery, elementClone: JQuery): void; + } } } From d559e87ca2f93274df6165f388c03d95c0360678 Mon Sep 17 00:00:00 2001 From: Dona278 Date: Fri, 9 Feb 2018 11:28:32 +0100 Subject: [PATCH 2/2] Fixed lint errors --- types/angular-material/angular-material-tests.ts | 6 +++--- types/angular-material/index.d.ts | 5 +---- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/types/angular-material/angular-material-tests.ts b/types/angular-material/angular-material-tests.ts index 06d98505ed..ad79cff2db 100644 --- a/types/angular-material/angular-material-tests.ts +++ b/types/angular-material/angular-material-tests.ts @@ -393,6 +393,6 @@ myApp.controller('StickyController', ($scope: TestScope, $mdSticky: ng.material. const stickyElement = angular.element(new Element()); const cloneStickyElement = stickyElement.clone(); - $mdSticky($scope, stickyElement); - $mdSticky($scope, stickyElement, cloneStickyElement); -}); \ No newline at end of file + $mdSticky($scope, stickyElement); + $mdSticky($scope, stickyElement, cloneStickyElement); +}); diff --git a/types/angular-material/index.d.ts b/types/angular-material/index.d.ts index e9263459f1..d77f5ae7ce 100644 --- a/types/angular-material/index.d.ts +++ b/types/angular-material/index.d.ts @@ -495,9 +495,6 @@ declare module 'angular' { configure(options: IProgressCircularConfig): void; } - interface IStickyService { - (scope: IScope, element: JQuery): void; - (scope: IScope, element: JQuery, elementClone: JQuery): void; - } + type IStickyService = (scope: IScope, element: JQuery, elementClone?: JQuery) => void; } }