Skip to content

Commit 9b982bc

Browse files
committed
fix(angular): update console logs
1 parent cc389c0 commit 9b982bc

File tree

3 files changed

+9
-5
lines changed

3 files changed

+9
-5
lines changed

packages/angular/common/src/directives/navigation/nav-params.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import { printIonWarning } from '@ionic/core';
2+
13
/**
24
* @description
35
* NavParams are an object that exists on a page and can contain data for that particular view.
@@ -20,8 +22,8 @@
2022
*/
2123
export class NavParams {
2224
constructor(public data: { [key: string]: any } = {}) {
23-
console.warn(
24-
`[Ionic Warning]: NavParams has been deprecated in favor of using Angular's input API. Developers should migrate to either the @Input decorator or the Signals-based input API.`
25+
printIonWarning(
26+
`NavParams has been deprecated in favor of using Angular's input API. Developers should migrate to either the @Input decorator or the Signals-based input API.`
2527
);
2628
}
2729

packages/angular/common/src/directives/navigation/tabs.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import {
1010
AfterViewInit,
1111
QueryList,
1212
} from '@angular/core';
13+
import { printIonError } from '@ionic/core';
1314

1415
import { NavController } from '../../providers/nav-controller';
1516

@@ -184,7 +185,7 @@ export abstract class IonTabs implements AfterViewInit, AfterContentInit, AfterC
184185
const selectedTab = tabs.find((t: any) => t.tab === tab);
185186

186187
if (!selectedTab) {
187-
console.error(`[Ionic Error]: Tab with id: "${tab}" does not exist`);
188+
printIonError(`Tab with id: "${tab}" does not exist`);
188189
return;
189190
}
190191

packages/angular/common/src/providers/angular-delegate.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import {
99
InjectionToken,
1010
ComponentRef,
1111
} from '@angular/core';
12+
import { printIonError } from '@ionic/core';
1213
import {
1314
FrameworkDelegate,
1415
LIFECYCLE_DID_ENTER,
@@ -164,8 +165,8 @@ export const attachView = (
164165
* which will cause collisions.
165166
*/
166167
if (elementReferenceKey && instance[elementReferenceKey] !== undefined) {
167-
console.error(
168-
`[Ionic Error]: ${elementReferenceKey} is a reserved property when using ${container.tagName.toLowerCase()}. Rename or remove the "${elementReferenceKey}" property from ${
168+
printIonError(
169+
`${elementReferenceKey} is a reserved property when using ${container.tagName.toLowerCase()}. Rename or remove the "${elementReferenceKey}" property from ${
169170
component.name
170171
}.`
171172
);

0 commit comments

Comments
 (0)