File tree Expand file tree Collapse file tree 2 files changed +44
-0
lines changed
Expand file tree Collapse file tree 2 files changed +44
-0
lines changed Original file line number Diff line number Diff line change 1+ /// <reference path='../angularjs/angular.d.ts' />
2+ /// <reference path='angular-dynamic-locale.d.ts' />
3+
4+ var app = angular . module ( 'testModule' , [ 'tmh.dynamicLocale' ] ) ;
5+ app . config ( ( localStorageServiceProvider : angular . dynamicLocale . tmhDynamicLocaleProvider ) => {
6+ localStorageServiceProvider
7+ . localeLocationPattern ( "app/config/locales/" )
8+ . useCookieStorage ( ) ;
9+ } ) ;
10+
11+ class LocaleTestController {
12+
13+ constructor ( tmhDynamicLocaleService : angular . dynamicLocale . tmhDynamicLocaleService ) {
14+
15+ var locale = tmhDynamicLocaleService . get ( ) ;
16+
17+ var newLocale = "mt"
18+ tmhDynamicLocaleService . set ( newLocale ) ;
19+ }
20+
21+ }
22+
23+ app . controller ( 'TestController' , LocaleTestController ) ;
Original file line number Diff line number Diff line change 1+ // Type definitions for angular-dynamic-locale v0.1.27
2+ // Project: https://github.com/lgalfaso/angular-dynamic-locale
3+ // Definitions by: Stephen Lautier <https://github.com/stephenlautier>
4+ // Definitions: https://github.com/borisyankov/DefinitelyTyped
5+
6+ /// <reference path="../angularjs/angular.d.ts" />
7+
8+ declare module angular . dynamicLocale {
9+
10+ interface tmhDynamicLocaleService {
11+ set ( locale : string ) : void ;
12+ get ( ) : string ;
13+ }
14+
15+ interface tmhDynamicLocaleProvider extends angular . IServiceProvider {
16+ localeLocationPattern ( location : string ) : tmhDynamicLocaleProvider ;
17+ localeLocationPattern ( ) : string ;
18+ useStorage ( storageName : string ) : void ;
19+ useCookieStorage ( ) : void ;
20+ }
21+ }
You can’t perform that action at this time.
0 commit comments