fix(angular): update console logs

This commit is contained in:
Brandy Smith
2025-04-14 16:55:34 -04:00
parent cc389c0f43
commit 9b982bcbde
3 changed files with 9 additions and 5 deletions

View File

@ -1,3 +1,5 @@
import { printIonWarning } from '@ionic/core';
/**
* @description
* NavParams are an object that exists on a page and can contain data for that particular view.
@ -20,8 +22,8 @@
*/
export class NavParams {
constructor(public data: { [key: string]: any } = {}) {
console.warn(
`[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.`
printIonWarning(
`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.`
);
}

View File

@ -10,6 +10,7 @@ import {
AfterViewInit,
QueryList,
} from '@angular/core';
import { printIonError } from '@ionic/core';
import { NavController } from '../../providers/nav-controller';
@ -184,7 +185,7 @@ export abstract class IonTabs implements AfterViewInit, AfterContentInit, AfterC
const selectedTab = tabs.find((t: any) => t.tab === tab);
if (!selectedTab) {
console.error(`[Ionic Error]: Tab with id: "${tab}" does not exist`);
printIonError(`Tab with id: "${tab}" does not exist`);
return;
}

View File

@ -9,6 +9,7 @@ import {
InjectionToken,
ComponentRef,
} from '@angular/core';
import { printIonError } from '@ionic/core';
import {
FrameworkDelegate,
LIFECYCLE_DID_ENTER,
@ -164,8 +165,8 @@ export const attachView = (
* which will cause collisions.
*/
if (elementReferenceKey && instance[elementReferenceKey] !== undefined) {
console.error(
`[Ionic Error]: ${elementReferenceKey} is a reserved property when using ${container.tagName.toLowerCase()}. Rename or remove the "${elementReferenceKey}" property from ${
printIonError(
`${elementReferenceKey} is a reserved property when using ${container.tagName.toLowerCase()}. Rename or remove the "${elementReferenceKey}" property from ${
component.name
}.`
);