Skip to content

Commit 0e9e85c

Browse files
committed
fix(bootstrap): only add customProviders when present
1 parent c7fa949 commit 0e9e85c

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

src/config/bootstrap.ts

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ export function ionicProviders(customProviders?: Array<any>, config?: any): any[
123123
setupDom(window, document, config, platform, clickBlock, featureDetect);
124124
bindEvents(window, document, platform, events);
125125

126-
return [
126+
let providers: any[] = [
127127
App,
128128
provide(ClickBlock, {useValue: clickBlock}),
129129
provide(Config, {useValue: config}),
@@ -136,9 +136,14 @@ export function ionicProviders(customProviders?: Array<any>, config?: any): any[
136136
Translate,
137137
TapClick,
138138
provide(PLATFORM_DIRECTIVES, {useValue: IONIC_DIRECTIVES, multi: true}),
139-
HTTP_PROVIDERS,
140-
customProviders
139+
HTTP_PROVIDERS
141140
];
141+
142+
if (isPresent(customProviders)) {
143+
providers.push(customProviders);
144+
}
145+
146+
return providers;
142147
}
143148

144149

0 commit comments

Comments
 (0)