ionic-team / ionic-framework

A powerful cross-platform UI toolkit for building native-quality iOS, Android, and Progressive Web Apps with HTML, CSS, and JavaScript.
https://ionicframework.com
MIT License
51.02k stars 13.51k forks source link

bug: Module '"@ionic/angular"' has no exported member 'IonBackButtonDelegate' #28827

Closed cmaere closed 9 months ago

cmaere commented 9 months ago

Prerequisites

Ionic Framework Version

v7.x

Current Behavior

After migrating to angular 17 and ionic 7 i get this error "Module '"@ionic/angular"' has no exported member 'IonBackButtonDelegate'. import IonBackButtonDelegate" Have you removed IonBackButtonDelegate?

Expected Behavior

with ionic 5 i was able to import IonBackButtonDelegate in my component and use it to listen to back click events

Steps to Reproduce

`import { Component, OnInit,ViewChild ,ElementRef, AfterViewInit} from '@angular/core'; import { Platform, IonContent,IonBackButtonDelegate } from '@ionic/angular';

@Component({ selector: 'app-chat', templateUrl: './chat.page.html', styleUrls: ['./chat.page.scss'], }) export class ChatPage implements OnInit {

@ViewChild(IonBackButtonDelegate, { static: false }) backButton: IonBackButtonDelegate;

constructor() { this.setUIBackButtonAction();

} setUIBackButtonAction() { this.backButton.onClick = () => { }; }

}

`

Code Reproduction URL

No response

Ionic Info

Ionic:

Ionic CLI : 6.20.1 (/usr/local/lib/node_modules/@ionic/cli) Ionic Framework : not installed @angular-devkit/build-angular : 17.0.10 @angular-devkit/schematics : 17.0.10 @angular/cli : 17.0.10 @ionic/angular-toolkit : 9.0.0

Capacitor:

Capacitor CLI : 3.6.0 @capacitor/android : 3.6.0 @capacitor/core : 3.6.0 @capacitor/ios : 3.6.0

Utility:

cordova-res (update available: 0.15.4) : 0.15.2 native-run (update available: 2.0.0) : 1.7.4

System:

NodeJS : v21.5.0 (/usr/local/bin/node) npm : 10.2.4 OS : macOS

Additional Information

No response

liamdebeasi commented 9 months ago

Thanks for the report. This should be fixed in https://github.com/ionic-team/ionic-framework/pull/28831. However, please note that this import will be renamed to IonBackButton in the next major release of Ionic Framework. You can take advantage of the new API name in Ionic 7.

liamdebeasi commented 9 months ago

Thanks for the issue. This has been resolved via https://github.com/ionic-team/ionic-framework/pull/28831, and a fix will be available in an upcoming release of Ionic Framework.

ionitron-bot[bot] commented 8 months ago

Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Ionic, please create a new issue and ensure the template is fully filled out.