I have this code in Ionic 3. In Ionic 4,
Cannot find module 'ionic-angular'.ts(2307)
How can I make it work in ionic 4? can find any solutions...
import { Events, Content } from 'ionic-angular';
@ViewChild(Content) content: Content;
this.content.resize();
this.content.scrollToBottom()
Follow these detailed migration steps in order to upgrade from Ionic 3 to 4: https://ionicframework.com/docs/building/migration
For this specific error the answer is:
import { Events, IonContent } from '@ionic/angular';
@ViewChild(IonContent) content: IonContent;
// resize() is removed in Ionic 4 (not needed)
this.content.scrollToBottom();
From ionic 4 you import statement of ionic-angular
slightly changed. please import like below.
import { Events, Content } from '@ionic/angular';
Here is a Demo on stackblitz
Hope this will help!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With