mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
27 lines
728 B
TypeScript
27 lines
728 B
TypeScript
import * as angular from 'angular';
|
|
|
|
var app = angular.module('testModule', ['tmh.dynamicLocale']);
|
|
app.config((localStorageServiceProvider: angular.dynamicLocale.tmhDynamicLocaleProvider) => {
|
|
localStorageServiceProvider
|
|
.localeLocationPattern("app/config/locales/")
|
|
.useCookieStorage();
|
|
localStorageServiceProvider.defaultLocale('en');
|
|
});
|
|
|
|
class LocaleTestController {
|
|
|
|
constructor(tmhDynamicLocaleService: angular.dynamicLocale.tmhDynamicLocaleService) {
|
|
|
|
var locale = tmhDynamicLocaleService.get();
|
|
|
|
var newLocale = "mt"
|
|
tmhDynamicLocaleService.set(newLocale);
|
|
|
|
newLocale = "en";
|
|
tmhDynamicLocaleService.set(newLocale).then((value) => {});
|
|
}
|
|
|
|
}
|
|
|
|
app.controller('TestController', LocaleTestController);
|