# Ionic 4 questions on app.modules setup

**URL:** <https://forum.ionicframework.com/t/ionic-4-questions-on-app-modules-setup/161647>\
**Category:** Ionic Framework\
**Created:** [April 15, 2019, 8:13am UTC](https://forum.ionicframework.com/t/ionic-4-questions-on-app-modules-setup/161647 "2019-04-15T08:13:23Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![garyc2232](https://avatars.discourse-cdn.com/v4/letter/g/7993a0/32.png) [@garyc2232](https://forum.ionicframework.com/u/garyc2232)\
**Post date:** [April 15, 2019, 8:13am UTC](https://forum.ionicframework.com/t/ionic-4-questions-on-app-modules-setup/161647/1 "2019-04-15T08:13:23Z")

</div>

Hi, i feel confuse about the declarations, app.modules.ts. Here is my situation.

I have a page `Home.page.ts`, a `headerComponent` and a `filterModal.page.ts`, the Modal will be called in the headerComponent.

First, i have import the page in the app.modules like below.

```auto
**app.modules.ts**
@NgModule({
  declarations: [
    ...
    filterModal // need to remove if build in --prod
  ],
  entryComponents: [filterModal],

```

Second i have set the page in the headerComponent and use the modalCtrl to call it out.

```auto
**headerComponent.ts**
import {filterModal} from '....';

async show(){
    this.modal = await this.modalCtrl.create({
      component: filterModal
    })
    return await this.modal.present();
  }

```

Third just import the headerComponent in the Home page

So here is the problem, In above setup, i can run it on local browser for testing without error. But if i build it in `--prod` flag, it will get me a error like `is part of the declarations of 2 modules:`.  
And i need to remove the declarations in app.modules.ts but after it removed, i cant view on local browser with this error `Component FilterPage is not part of any NgModule or the module has not been imported into your module.`

I am not sure which one is correct, the filterModal will only used on the HomePage.
