added angular-dynamic-locale definitions

This commit is contained in:
stephen.lautier
2015-06-10 22:36:23 +02:00
parent abb8a7f490
commit fa362c0ba9
2 changed files with 44 additions and 0 deletions

View File

@@ -0,0 +1,23 @@
/// <reference path='../angularjs/angular.d.ts' />
/// <reference path='angular-dynamic-locale.d.ts' />
var app = angular.module('testModule', ['tmh.dynamicLocale']);
app.config((localStorageServiceProvider: angular.dynamicLocale.tmhDynamicLocaleProvider) => {
localStorageServiceProvider
.localeLocationPattern("app/config/locales/")
.useCookieStorage();
});
class LocaleTestController {
constructor(tmhDynamicLocaleService: angular.dynamicLocale.tmhDynamicLocaleService) {
var locale = tmhDynamicLocaleService.get();
var newLocale = "mt"
tmhDynamicLocaleService.set(newLocale);
}
}
app.controller('TestController', LocaleTestController);

View File

@@ -0,0 +1,21 @@
// Type definitions for angular-dynamic-locale v0.1.27
// Project: https://github.com/lgalfaso/angular-dynamic-locale
// Definitions by: Stephen Lautier <https://github.com/stephenlautier>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
/// <reference path="../angularjs/angular.d.ts" />
declare module angular.dynamicLocale {
interface tmhDynamicLocaleService {
set(locale: string): void;
get(): string;
}
interface tmhDynamicLocaleProvider extends angular.IServiceProvider {
localeLocationPattern(location: string): tmhDynamicLocaleProvider;
localeLocationPattern(): string;
useStorage(storageName: string): void;
useCookieStorage(): void;
}
}