Can someone assist me in configuring my module to recognize the new pages I generated? Using the ionic command ionic generate page
in my terminal, I successfully created two new pages in my file tree: one named privacy-policy and the other terms-of-use.
The construction of these new pages went smoothly:
Privacy Policy Page
/*
Generated class for the PrivacyPolicy page.
Ionic pages and navigation.
*/
@Component({
selector: 'page-privacy-policy',
templateUrl: 'privacy-policy.html'
})
export class PrivacyPolicyPage {
constructor(public navCtrl: NavController) {}
ionViewDidLoad() {
console.log('Hello PrivacyPolicyPage Page');
}
}
Terms of Use Page
/*
Generated class for the TermsOfUse page.
*/
@Component({
selector: 'page-terms-of-use',
templateUrl: 'terms-of-use.html'
})
export class TermsOfUsePage {
constructor(public navCtrl: NavController) {}
ionViewDidLoad() {
console.log('Hello TermsOfUsePage Page');
}
}
However, when trying to link these pages to a nav controller on another page, I encountered build errors in the terminal stating
cannot determine module for component PrivacyPolicyPage
(and terms of use page as well). Upon adding the pages to the module in app.module.ts
, an error was thrown mentioning unexpected value PrivacyPolicyPage declared by the module AppModule
.
I am unsure of what steps to take next. The following is the content of my app.module.ts file:
import { NgModule, ErrorHandler } from '@angular/core';
import { IonicApp, IonicModule, IonicErrorHandler } from 'ionic-angular';
//other imports
import { TermsOfUsePage } from '../terms-of-use/terms-of-use';
import { PrivacyPolicyPage } from '../privacy-policy/privacy-policy';
@NgModule({
declarations: [
*otherPages*,
*otherPages*,
TermsOfUsePage,
PrivacyPolicyPage
],
imports: [
IonicModule.forRoot(MyApp)
],
bootstrap: [IonicApp],
entryComponents: [
*otherPages*,
*otherPages*,
TermsOfUsePage,
PrivacyPolicyPage
],
providers: [{provide: ErrorHandler, useClass: IonicErrorHandler}]
})
export class AppModule {}