Skip to content

Commit 6784f5e

Browse files
committed
fix(exports): update module exports
1 parent 8585427 commit 6784f5e

File tree

8 files changed

+67
-114
lines changed

8 files changed

+67
-114
lines changed

src/components/tap-click/tap-click.ts

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -230,16 +230,3 @@ export function setupTapClick(config: Config, app: App, zone: NgZone) {
230230
return new TapClick(config, app, zone);
231231
};
232232
}
233-
234-
export function provideTapClick() {
235-
return {
236-
provide: APP_INITIALIZER,
237-
useFactory: setupTapClick,
238-
deps: [
239-
Config,
240-
App,
241-
NgZone
242-
],
243-
multi: true
244-
};
245-
}

src/config/config.ts

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -376,18 +376,3 @@ export function setupConfig(userConfig: any, queryParams: QueryParams, platform:
376376
config.init(userConfig, queryParams, platform);
377377
return config;
378378
}
379-
380-
export function provideConfig(userConfig: any): any {
381-
return [
382-
{ provide: UserConfig, useValue: userConfig },
383-
{
384-
provide: Config,
385-
useFactory: setupConfig,
386-
deps: [
387-
UserConfig,
388-
QueryParams,
389-
Platform
390-
]
391-
}
392-
];
393-
}

src/index.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11

2-
export { Config } from './config/config';
3-
export { IonicModule } from './module';
4-
2+
export * from './module';
53
export * from './directives';
64

75
export * from './gestures/drag-gesture';
@@ -10,6 +8,7 @@ export * from './gestures/slide-edge-gesture';
108
export * from './gestures/slide-gesture';
119
export * from './gestures/gesture-controller';
1210

11+
export * from './config/config';
1312
export * from './platform/platform';
1413
export * from './storage/storage';
1514
export * from './storage/sql';

src/module.ts

Lines changed: 64 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,18 @@
1-
import { ANALYZE_FOR_ENTRY_COMPONENTS, ModuleWithProviders, NgModule } from '@angular/core';
1+
import { ANALYZE_FOR_ENTRY_COMPONENTS, APP_INITIALIZER, ModuleWithProviders, NgModule, NgZone } from '@angular/core';
2+
import { Location, LocationStrategy, HashLocationStrategy } from '@angular/common';
23
import { BrowserModule, HAMMER_GESTURE_CONFIG } from '@angular/platform-browser';
34
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
45
import { HttpModule } from '@angular/http';
56

6-
77
/**
88
* Import Providers
99
*/
1010
import { ActionSheetController } from './components/action-sheet/action-sheet';
1111
import { AlertController } from './components/alert/alert';
1212
import { App } from './components/app/app';
13-
import { provideConfig } from './config/config';
14-
import { provideEvents } from './util/events';
13+
import { Config, UserConfig, setupConfig } from './config/config';
14+
import { DeepLinker, setupDeepLinker, UserDeepLinkConfig } from './navigation/deep-linker';
15+
import { setupProvideEvents } from './util/events';
1516
import { FeatureDetect } from './util/feature-detect';
1617
import { Form } from './util/form';
1718
import { GestureController } from './gestures/gesture-controller';
@@ -21,26 +22,19 @@ import { LoadingController } from './components/loading/loading';
2122
import { MenuController } from './components/menu/menu-controller';
2223
import { ModalController } from './components/modal/modal';
2324
import { PickerController } from './components/picker/picker';
24-
import { providePlatform, UserAgent, UserNavigatorPlatform, UserDir, UserLang } from './platform/platform';
25+
import { Platform, setupPlatform, UserAgent, UserNavigatorPlatform, UserDir, UserLang } from './platform/platform';
2526
import { PopoverController } from './components/popover/popover';
26-
import { provideDeepLinker } from './navigation/deep-linker';
27-
import { provideQueryParams, UserUrl } from './platform/query-params';
28-
import { TapClick, provideTapClick } from './components/tap-click/tap-click';
27+
import { QueryParams, setupQueryParams, UserUrl } from './platform/query-params';
28+
import { TapClick, setupTapClick } from './components/tap-click/tap-click';
2929
import { ToastController } from './components/toast/toast';
3030
import { Translate } from './translation/translate';
3131
import { TransitionController } from './transitions/transition-controller';
3232
import { UserRoot } from './components/app/app-root';
33-
33+
import { UrlSerializer } from './navigation/url-serializer';
3434

3535
/**
36-
* Export Providers
36+
* Import Overlay Entry Components
3737
*/
38-
export { DeepLinker, provideDeepLinker } from './navigation/deep-linker';
39-
export { NavController } from './navigation/nav-controller';
40-
export { NavParams } from './navigation/nav-params';
41-
export { NavLink, NavOptions, DeepLink, DeepLinkConfig } from './navigation/nav-util';
42-
export { ViewController } from './navigation/view-controller';
43-
4438
import { ActionSheetCmp } from './components/action-sheet/action-sheet-component';
4539
import { AlertCmp } from './components/alert/alert-component';
4640
import { IONIC_DIRECTIVES } from './directives';
@@ -51,6 +45,16 @@ import { PickerCmp } from './components/picker/picker-component';
5145
import { PopoverCmp } from './components/popover/popover-component';
5246
import { ToastCmp } from './components/toast/toast-component';
5347

48+
/**
49+
* Export Providers
50+
*/
51+
export { DeepLinker, UserDeepLinkConfig } from './navigation/deep-linker';
52+
export { NavController } from './navigation/nav-controller';
53+
export { NavParams } from './navigation/nav-params';
54+
export { NavLink, NavOptions, DeepLink, DeepLinkConfig } from './navigation/nav-util';
55+
export { UrlSerializer } from './navigation/url-serializer';
56+
export { ViewController } from './navigation/view-controller';
57+
5458

5559
@NgModule({
5660
imports: [BrowserModule, HttpModule, FormsModule, ReactiveFormsModule],
@@ -83,20 +87,54 @@ export class IonicModule {
8387
ngModule: IonicModule,
8488
providers: [
8589
{ provide: ANALYZE_FOR_ENTRY_COMPONENTS, useValue: userAppRoot, multi: true },
90+
{ provide: APP_INITIALIZER, useFactory: setupTapClick,
91+
deps: [
92+
Config,
93+
App,
94+
NgZone
95+
],
96+
multi: true
97+
},
98+
{ provide: APP_INITIALIZER, useFactory: setupProvideEvents, deps: [ Platform ], multi: true },
99+
{ provide: Config, useFactory: setupConfig,
100+
deps: [
101+
UserConfig,
102+
QueryParams,
103+
Platform
104+
]
105+
},
106+
{ provide: DeepLinker, useFactory: setupDeepLinker,
107+
deps: [
108+
App,
109+
UrlSerializer,
110+
Location
111+
]
112+
},
86113
{ provide: HAMMER_GESTURE_CONFIG, useClass: IonicGestureConfig },
114+
{ provide: LocationStrategy, useClass: HashLocationStrategy },
115+
{ provide: Platform, useFactory: setupPlatform,
116+
deps: [
117+
QueryParams,
118+
UserAgent,
119+
UserNavigatorPlatform,
120+
UserDir,
121+
UserLang,
122+
NgZone
123+
]
124+
},
125+
{ provide: QueryParams, useFactory: setupQueryParams,
126+
deps: [
127+
UserUrl
128+
]
129+
},
87130
{ provide: UserAgent, useFactory: getWindowUserAgent },
88131
{ provide: UserDir, useFactory: getDocumentDir },
89132
{ provide: UserLang, useFactory: getDocumentLang },
90133
{ provide: UserNavigatorPlatform, useFactory: getWindowPlatform },
91134
{ provide: UserRoot, useValue: userAppRoot },
92135
{ provide: UserUrl, useFactory: getWindowLocation },
93-
94-
provideConfig(userConfig),
95-
provideDeepLinker(userDeepLinkConfig),
96-
provideEvents(),
97-
providePlatform(),
98-
provideQueryParams(),
99-
provideTapClick(),
136+
{ provide: UserConfig, useValue: userConfig },
137+
{ provide: UserDeepLinkConfig, useValue: userDeepLinkConfig },
100138

101139
ActionSheetController,
102140
AlertController,
@@ -106,14 +144,16 @@ export class IonicModule {
106144
GestureController,
107145
Keyboard,
108146
LoadingController,
147+
Location,
109148
MenuController,
110149
ModalController,
111150
PickerController,
112151
PopoverController,
113152
TapClick,
114153
ToastController,
115154
Translate,
116-
TransitionController
155+
TransitionController,
156+
UrlSerializer
117157
]
118158
};
119159
}

src/navigation/deep-linker.ts

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { Injectable, OpaqueToken } from '@angular/core';
2-
import { Location, LocationStrategy, HashLocationStrategy } from '@angular/common';
2+
import { Location } from '@angular/common';
33

44
import { App } from '../components/app/app';
55
import { convertToViews, isNav, isTab, isTabs, NavSegment, DIRECTION_BACK } from './nav-util';
@@ -418,25 +418,6 @@ export function setupDeepLinker(app: App, serializer: UrlSerializer, location: L
418418
export const UserDeepLinkConfig = new OpaqueToken('USERLINKS');
419419

420420

421-
export function provideDeepLinker(userDeepLinkConfig: any): any[] {
422-
return [
423-
UrlSerializer,
424-
Location,
425-
{ provide: UserDeepLinkConfig, useValue: userDeepLinkConfig },
426-
{ provide: LocationStrategy, useClass: HashLocationStrategy },
427-
{
428-
provide: DeepLinker,
429-
useFactory: setupDeepLinker,
430-
deps: [
431-
App,
432-
UrlSerializer,
433-
Location
434-
]
435-
},
436-
];
437-
}
438-
439-
440421
export function normalizeUrl(browserUrl: string): string {
441422
browserUrl = browserUrl.trim();
442423
if (browserUrl.charAt(0) !== '/') {

src/platform/platform.ts

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -844,19 +844,3 @@ export const UserAgent = new OpaqueToken('USERAGENT');
844844
export const UserNavigatorPlatform = new OpaqueToken('USERNAVPLT');
845845
export const UserDir = new OpaqueToken('USERDIR');
846846
export const UserLang = new OpaqueToken('USERLANG');
847-
848-
849-
export function providePlatform(): any {
850-
return {
851-
provide: Platform,
852-
useFactory: setupPlatform,
853-
deps: [
854-
QueryParams,
855-
UserAgent,
856-
UserNavigatorPlatform,
857-
UserDir,
858-
UserLang,
859-
NgZone
860-
]
861-
};
862-
}

src/platform/query-params.ts

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,3 @@ export const UserUrl = new OpaqueToken('USERURL');
3232
export function setupQueryParams(url: string): QueryParams {
3333
return new QueryParams(url);
3434
}
35-
36-
export function provideQueryParams(): any {
37-
return {
38-
provide: QueryParams,
39-
useFactory: setupQueryParams,
40-
deps: [
41-
UserUrl
42-
]
43-
};
44-
}

src/util/events.ts

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
import { APP_INITIALIZER } from '@angular/core';
2-
31
import { nativeTimeout } from '../util/dom';
42
import { Platform } from '../platform/platform';
53
import { ScrollView } from '../util/scroll-view';
@@ -152,14 +150,3 @@ export function setupProvideEvents(platform: Platform) {
152150
return setupEvents(platform);
153151
};
154152
}
155-
156-
export function provideEvents() {
157-
return {
158-
provide: APP_INITIALIZER,
159-
useFactory: setupProvideEvents,
160-
deps: [
161-
Platform
162-
],
163-
multi: true
164-
};
165-
}

0 commit comments

Comments
 (0)