I'm Learning Ionic v4 and the template are compiled successfully. But when I change these template to components examples like this one below, It gives error that I mention below.
What did i do wrong? And if the process I made for testing alert is wrong, how can I test codes and add pages in ionic?
I would be grateful if anyone can help me learn to use ionic. I have project to deliver in 2 weeks Thanks
import { Component } from '@angular/core';
import { AlertController } from 'ionic-angular';
@Component({
templateUrl: 'template.html'
})
export class BasicPage {
constructor(public alerCtrl: AlertController) { }
doAlert() {
let alert = this.alerCtrl.create({
title: 'New Friend!',
message: 'Your friend, Obi wan Kenobi, just approved your
friend request!',
buttons: ['Ok']
});
alert.present()
}
}
ERROR in ./src/app/tab3/tab3.module.ts 16:58- 66 [ng] "export 'Tab3Page' was not found in './tab3.page' [ng] ERROR in ./src/app/tab3/tab3.module.ts 18:23- 31 [ng] "export 'Tab3Page' was not found in './tab3.page' [ng] ERROR in ./src/app/tab3/tab3.page.ts [ng] Module not found: ./src/app/tab3/tab3.page.ts [ng] Module not found: Error: Can't resolve 'ionic-angular' in 'C:\Users\ASUS\Ionic\ app\src\app\tab3' [ng] Time: 797ms [ng] i 「wdm」: Failed to compile. [ng] [ng] ERROR in src/app/tab3/tab3.module.ts(6,10): error TS2305: Module '"C:/Users/ASUS/Ionic/app /src/app/tab3/tab3.page"' has no exported member 'Tab3Page'. [ng] src/app/tab3/tab3.page.ts(3,33): error TS2307: Cannot find module 'ionic-angular'**
There are various update in Ionic4.
import { AlertController } from '@ionic/angular'; // Ionic 4
import { AlertController } from 'ionic/angular'; // Ionic 3
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments