Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix(angular): replace consoles logs with printIonWarning and printErr…
…orWarning
  • Loading branch information
brandyscarney committed Apr 10, 2025
commit 896c3262fc6b5062b7e979e1989c34965ad7d01d
Original file line number Diff line number Diff line change
@@ -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.
Expand All @@ -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.`
);
}

Expand Down
4 changes: 3 additions & 1 deletion packages/angular/common/src/directives/navigation/tabs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ import {
QueryList,
} from '@angular/core';

import { printIonError } from '@ionic/core';

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

import { StackDidChangeEvent, StackWillChangeEvent } from './stack-utils';
Expand Down Expand Up @@ -184,7 +186,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;
}

Expand Down
6 changes: 4 additions & 2 deletions packages/angular/common/src/providers/angular-delegate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ import {
LIFECYCLE_WILL_UNLOAD,
} from '@ionic/core/components';

import { printIonError } from '@ionic/core';

import { NavParams } from '../directives/navigation/nav-params';

import { ConfigToken } from './config';
Expand Down Expand Up @@ -164,8 +166,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
}.`
);
Expand Down