mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-06-06 06:19:58 +08:00
Fixed failing tests
This commit is contained in:
@@ -1,8 +1,12 @@
|
||||
import * as angular from "angular";
|
||||
import {ClipboardService} from "angular-clipboard";
|
||||
|
||||
interface TestScope extends ng.IScope {
|
||||
[index: string]: any;
|
||||
}
|
||||
|
||||
const app = angular.module('testModule', ['angular-clipboard']);
|
||||
app.controller('TestController', ($scope: ng.IScope, clipboard: ClipboardService) => {
|
||||
app.controller('TestController', ($scope: TestScope, clipboard: ClipboardService) => {
|
||||
$scope['testCopy'] = () => {
|
||||
if (clipboard.supported) {
|
||||
clipboard.copyText('hiiiiiii');
|
||||
|
||||
@@ -1,5 +1,10 @@
|
||||
import * as angular from 'angular';
|
||||
|
||||
|
||||
interface TestScope extends angular.IScope {
|
||||
[index: string]: any;
|
||||
}
|
||||
|
||||
angular
|
||||
.module('angular-locker-tests', ['angular-locker'])
|
||||
.config(['lockerProvider', function config(lockerProvider: angular.locker.ILockerProvider) {
|
||||
@@ -13,7 +18,7 @@ angular
|
||||
|
||||
lockerProvider.defaults(lockerSettings);
|
||||
}])
|
||||
.controller('LockerController', ['$scope', 'locker', function ($scope: angular.IScope, locker: angular.locker.ILockerService) {
|
||||
.controller('LockerController', ['$scope', 'locker', function ($scope: TestScope, locker: angular.locker.ILockerService) {
|
||||
locker.put('someKey', 'someVal');
|
||||
|
||||
// put an item into session storage
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
const myApp = angular.module('testModule', ['ngMaterial']);
|
||||
|
||||
interface TestScope extends ng.IScope {
|
||||
[index: string]: any;
|
||||
}
|
||||
|
||||
myApp.config((
|
||||
$mdThemingProvider: ng.material.IThemingProvider,
|
||||
$mdIconProvider: ng.material.IIconProvider,
|
||||
@@ -50,7 +54,7 @@ myApp.config((
|
||||
});
|
||||
});
|
||||
|
||||
myApp.controller('BottomSheetController', ($scope: ng.IScope, $mdBottomSheet: ng.material.IBottomSheetService, $q: ng.IQService) => {
|
||||
myApp.controller('BottomSheetController', ($scope: TestScope, $mdBottomSheet: ng.material.IBottomSheetService, $q: ng.IQService) => {
|
||||
$scope['openBottomSheet'] = () => {
|
||||
$mdBottomSheet.show({
|
||||
template: '<md-bottom-sheet>Hello!</md-bottom-sheet>',
|
||||
@@ -84,7 +88,7 @@ myApp.controller('BottomSheetController', ($scope: ng.IScope, $mdBottomSheet: ng
|
||||
$scope['cancelBottomSheet'] = $mdBottomSheet.cancel.bind($mdBottomSheet, 'cancel');
|
||||
});
|
||||
|
||||
myApp.controller('ColorController', ($scope: ng.IScope, $mdColor: ng.material.IColorService) => {
|
||||
myApp.controller('ColorController', ($scope: TestScope, $mdColor: ng.material.IColorService) => {
|
||||
const colorExpression: ng.material.IColorExpression = { color: '#FFFFFF' };
|
||||
const element: Element = new Element();
|
||||
|
||||
@@ -99,7 +103,7 @@ myApp.controller('ColorController', ($scope: ng.IScope, $mdColor: ng.material.IC
|
||||
};
|
||||
});
|
||||
|
||||
myApp.controller('DialogController', ($scope: ng.IScope, $mdDialog: ng.material.IDialogService, $q: ng.IQService) => {
|
||||
myApp.controller('DialogController', ($scope: TestScope, $mdDialog: ng.material.IDialogService, $q: ng.IQService) => {
|
||||
$scope['openDialog'] = () => {
|
||||
$mdDialog.show({
|
||||
template: '<md-dialog>Hello!</md-dialog>'
|
||||
@@ -201,7 +205,7 @@ class IconDirective implements ng.IDirective {
|
||||
}
|
||||
myApp.directive('icon-directive', ($mdIcon: ng.material.IIcon) => new IconDirective($mdIcon));
|
||||
|
||||
myApp.controller('MediaController', ($scope: ng.IScope, $mdMedia: ng.material.IMedia) => {
|
||||
myApp.controller('MediaController', ($scope: TestScope, $mdMedia: ng.material.IMedia) => {
|
||||
$scope.$watch(() => $mdMedia('lg'), (big: boolean) => {
|
||||
$scope['bigScreen'] = big;
|
||||
});
|
||||
@@ -210,7 +214,7 @@ myApp.controller('MediaController', ($scope: ng.IScope, $mdMedia: ng.material.IM
|
||||
$scope['anotherCustom'] = $mdMedia('max-width: 300px');
|
||||
});
|
||||
|
||||
myApp.controller('SidenavController', ($scope: ng.IScope, $mdSidenav: ng.material.ISidenavService) => {
|
||||
myApp.controller('SidenavController', ($scope: TestScope, $mdSidenav: ng.material.ISidenavService) => {
|
||||
const componentId = 'left';
|
||||
$scope['toggle'] = () => $mdSidenav(componentId).toggle();
|
||||
$scope['open'] = () => $mdSidenav(componentId).open();
|
||||
@@ -229,7 +233,7 @@ myApp.controller('SidenavController', ($scope: ng.IScope, $mdSidenav: ng.materia
|
||||
$scope['onClose'] = $mdSidenav(componentId).onClose(() => { });
|
||||
});
|
||||
|
||||
myApp.controller('ToastController', ($scope: ng.IScope, $mdToast: ng.material.IToastService, $q: ng.IQService) => {
|
||||
myApp.controller('ToastController', ($scope: TestScope, $mdToast: ng.material.IToastService, $q: ng.IQService) => {
|
||||
$scope['openToast'] = () => {
|
||||
$mdToast.show($mdToast.simple().textContent('Hello!'));
|
||||
$mdToast.updateTextContent('New Content');
|
||||
@@ -260,7 +264,7 @@ myApp.controller('ToastController', ($scope: ng.IScope, $mdToast: ng.material.IT
|
||||
};
|
||||
});
|
||||
|
||||
myApp.controller('PanelController', ($scope: ng.IScope, $mdPanel: ng.material.IPanelService, $q: ng.IQService) => {
|
||||
myApp.controller('PanelController', ($scope: TestScope, $mdPanel: ng.material.IPanelService, $q: ng.IQService) => {
|
||||
$scope['createPanel'] = () => {
|
||||
const config: ng.material.IPanelConfig = {
|
||||
id: 'myPanel',
|
||||
|
||||
@@ -27,6 +27,8 @@ interface CustomScope extends angular.meteor.IScope {
|
||||
removeAll: () => void;
|
||||
removeAuto: (todo: ITodo) => void;
|
||||
toSticky: (todo: ITodo) => void;
|
||||
|
||||
picture: any;
|
||||
}
|
||||
|
||||
var Todos = new Mongo.Collection<ITodo>('todos');
|
||||
|
||||
4
types/angular-resource/index.d.ts
vendored
4
types/angular-resource/index.d.ts
vendored
@@ -53,14 +53,14 @@ declare module 'angular' {
|
||||
interface IActionHash {
|
||||
[action: string]: IActionDescriptor;
|
||||
}
|
||||
|
||||
|
||||
interface IResourceResponse {
|
||||
config: any;
|
||||
data: any;
|
||||
headers: any;
|
||||
resource: any;
|
||||
status: number;
|
||||
statusText: string
|
||||
statusText: string;
|
||||
}
|
||||
|
||||
interface IResourceInterceptor {
|
||||
|
||||
@@ -23,8 +23,12 @@ namespace application {
|
||||
|
||||
myApp.factory('DatasourceTest', factory);
|
||||
|
||||
interface TestScope extends ng.IScope {
|
||||
[index: string]: any;
|
||||
}
|
||||
|
||||
// demo/examples/adapter
|
||||
myApp.controller('mainController', ['$scope', 'DatasourceTest', function($scope: ng.IScope, datasource: DatasourceTest) {
|
||||
myApp.controller('mainController', ['$scope', 'DatasourceTest', function($scope: TestScope, datasource: DatasourceTest) {
|
||||
var firstListAdapter: ng.ui.IScrollAdapter, secondListAdapter: ng.ui.IScrollAdapter;
|
||||
$scope['datasource'] = datasource;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user