mirror of
https://github.com/wassname/DefinitelyTyped.git
synced 2026-09-09 11:13:57 +08:00
add declare module
This commit is contained in:
@@ -5,9 +5,9 @@ interface TestScope extends ng.IScope {
|
||||
viewType: string;
|
||||
}
|
||||
|
||||
module angularLocalStorageTests {
|
||||
module ng.LocalStorageTests {
|
||||
export class TestController {
|
||||
constructor(private $scope: TestScope, private storage: AngularLocalStorageService) {
|
||||
constructor(private $scope: TestScope, private storage: ng.localStorage.ILocalStorageService) {
|
||||
storage.bind($scope, 'varName');
|
||||
storage.bind($scope,'varName', { defaultValue: 'randomValue123', storeName: 'customStoreKey' });
|
||||
$scope.viewType = 'ANYTHING';
|
||||
@@ -23,5 +23,5 @@ module angularLocalStorageTests {
|
||||
}
|
||||
|
||||
var app = angular.module('angularLocalStorageTests', ['angularLocalStorage']);
|
||||
app.controller('testCtrl', ['$scope', 'storage', ($scope: TestScope, storage: AngularLocalStorageService) => new angularLocalStorageTests.TestController($scope, storage)]);
|
||||
app.controller('testCtrl', ['$scope', 'storage', ($scope: TestScope, storage: ng.localStorage.ILocalStorageService) => new ng.LocalStorageTests.TestController($scope, storage)]);
|
||||
|
||||
|
||||
+12
-10
@@ -5,16 +5,18 @@
|
||||
|
||||
/// <reference path="../angularjs/angular.d.ts"/>
|
||||
|
||||
interface AngularLocalStorageService {
|
||||
set(key: string, value: any): any;
|
||||
get(key: string): any;
|
||||
remove(key: string): boolean;
|
||||
clearAll(): void;
|
||||
declare module ng.localStorage {
|
||||
interface ILocalStorageService {
|
||||
set(key: string, value: any): any;
|
||||
get(key: string): any;
|
||||
remove(key: string): boolean;
|
||||
clearAll(): void;
|
||||
|
||||
bind($scope: ng.IScope, key: string, opts?: {
|
||||
defaultValue?: any;
|
||||
storeName?: string;
|
||||
}): any;
|
||||
unbind($scope: ng.IScope, key: string, storeName?: string): void;
|
||||
bind($scope: ng.IScope, key: string, opts?: {
|
||||
defaultValue?: any;
|
||||
storeName?: string;
|
||||
}): any;
|
||||
unbind($scope: ng.IScope, key: string, storeName?: string): void;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user