I can't import my AboutPage in home.ts file

I can’t import my AboutPage in home.ts file in ionic 2/3

For example, I I write " import {About Page} from ’ …/about/about’ " in home.ts file that time It is showing " ‘…/src/pages/about/about’ has no exported member ‘AboutPage’

So do you export AboutPage in that file? What does it look like?

I don’t know how to export it :rolling_eyes:

So what does your about.ts look like?

import { Component } from '@angular/core';
import { IonicPage, NavController, NavParams } from 'ionic-angular';

/**
 * Generated class for the About page.
 *
 * See http://ionicframework.com/docs/components/#navigation for more info
 * on Ionic pages and navigation.
 */
@IonicPage()
@Component({
  selector: 'page-about',
  templateUrl: 'about.html',
})
export class About {

  constructor(public navCtrl: NavController, public navParams: NavParams) {
  }

  ionViewDidLoad() {
    console.log('ionViewDidLoad About');
  }

}

You are exporting the class as “About”, so you should also import it as “About”.

(By the way: there is a button “</>” in the toolbar you can press to “format text as code”)

1 Like

Ohhh Thanks @Sujan12 :relaxed:

Personally, I liked it better when the generators appended ‘Page’ to the names of generated pages.

2 Likes