Skip to content

Commit cc389c0

Browse files
committed
fix(angular): initialize config in forRoot
1 parent 8dd566b commit cc389c0

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

core/src/utils/logging/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ export const enum LogLevel {
1313
* @param message - The string message to be logged to the console.
1414
*/
1515
export const printIonWarning = (message: string, ...params: any[]) => {
16+
console.log('printIonWarning', config.get('logLevel'));
1617
const logLevel = config.get('logLevel', LogLevel.WARN);
1718
if ([LogLevel.WARN].includes(logLevel)) {
1819
return console.warn(`[Ionic Warning]: ${message}`, ...params);
@@ -27,6 +28,7 @@ export const printIonWarning = (message: string, ...params: any[]) => {
2728
* @param params - Additional arguments to supply to the console.error.
2829
*/
2930
export const printIonError = (message: string, ...params: any[]) => {
31+
console.log('printIonError', config.get('logLevel'));
3032
const logLevel = config.get('logLevel', LogLevel.ERROR);
3133
if ([LogLevel.ERROR, LogLevel.WARN].includes(logLevel)) {
3234
return console.error(`[Ionic Error]: ${message}`, ...params);

packages/angular/src/ionic-module.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { CommonModule, DOCUMENT } from '@angular/common';
22
import { ModuleWithProviders, APP_INITIALIZER, NgModule, NgZone } from '@angular/core';
33
import { ConfigToken, AngularDelegate, provideComponentInputBinding } from '@ionic/angular/common';
4-
import { IonicConfig } from '@ionic/core';
4+
import { initialize, IonicConfig, setupConfig } from '@ionic/core';
55

66
import { appInitialize } from './app-initialize';
77
import {
@@ -64,6 +64,9 @@ type OptInAngularFeatures = {
6464
})
6565
export class IonicModule {
6666
static forRoot(config: IonicConfig & OptInAngularFeatures = {}): ModuleWithProviders<IonicModule> {
67+
setupConfig(config);
68+
initialize(config);
69+
6770
return {
6871
ngModule: IonicModule,
6972
providers: [

0 commit comments

Comments
 (0)