# Rename a tab title in an ionic project

**URL:** <https://forum.ionicframework.com/t/rename-a-tab-title-in-an-ionic-project/129922>\
**Category:** ionic-v3\
**Created:** [May 7, 2018, 5:15pm UTC](https://forum.ionicframework.com/t/rename-a-tab-title-in-an-ionic-project/129922 "2018-05-07T17:15:25Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![IAmos](https://avatars.discourse-cdn.com/v4/letter/i/a587f6/32.png) [@IAmos](https://forum.ionicframework.com/u/IAmos)\
**Post date:** [May 7, 2018, 5:15pm UTC](https://forum.ionicframework.com/t/rename-a-tab-title-in-an-ionic-project/129922/1 "2018-05-07T17:15:25Z")

</div>

Hi

I’m new to Ionic and vscode so I started a new project of ionic in vscode. For testing purposes, I renamed HomePage to AccountPage - all references were changed as expected. I also renamed Home folder + 3 files (ts/html/css) to account and their references in the code.

I then changed Home to Account in account.html

```auto
> <ion-header>
> <ion-navbar>
> <ion-title>Account</ion-title>
> </ion-navbar>
> </ion-header>

```

and in tabs.html

```auto
> <ion-tabs>
> <ion-tab [root]="tab1Root" tabTitle="Account" tabIcon="home"></ion-tab>
> <ion-tab [root]="tab2Root" tabTitle="About" tabIcon="information-circle"></ion-tab>
> <ion-tab [root]="tab3Root" tabTitle="Contact" tabIcon="contacts"></ion-tab>
> </ion-tabs>

```

The only error I see is in account.ts under ` @Component({`

> [Angular] Component ‘AccountPage’ is not included in a module and will not be available inside a template. Consider adding it to a NgModule declaration

and I’m not sure what to do with it because there are no more Home references anywhere in the code. Also, when running the app, it works with no error except for the fact that I still see Home in the app (browser) instead of Account. What am I missing? Thanks

---

<div class="post-metadata">

**Author:** ![lucasbasquerotto](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/lucasbasquerotto/32/101719_2.png) [@lucasbasquerotto](https://forum.ionicframework.com/u/lucasbasquerotto)\
**Post date:** [May 7, 2018, 6:30pm UTC](https://forum.ionicframework.com/t/rename-a-tab-title-in-an-ionic-project/129922/2 "2018-05-07T18:30:50Z")

</div>

Try to add `AccountPage` to your app module (see if the other pages are in the `AppModule`).

You can search the page references in your IDE/Editor (if you are using VSCode, right click on the page name and `Find All references`).

Compare where your other pages are imported (in which `NgModule`) and do the same with your `AccountPage`. If they are imported in `AppModule` (`/src/app/app.module.ts`), just add your `AccountPage` there too.

---

<div class="post-metadata">

**Author:** ![IAmos](https://avatars.discourse-cdn.com/v4/letter/i/a587f6/32.png) [@IAmos](https://forum.ionicframework.com/u/IAmos)\
**Post date:** [May 7, 2018, 7:07pm UTC](https://forum.ionicframework.com/t/rename-a-tab-title-in-an-ionic-project/129922/3 "2018-05-07T19:07:26Z")

</div>

Thank you for your reply. This is taken from app.module.ts

```auto
import { AboutPage } from '../pages/about/about';
import { ContactPage } from '../pages/contact/contact';
import { AccountPage } from '../pages/account/account';
import { TabsPage } from '../pages/tabs/tabs';

```

As you can see, all 3 pages are there. Also, this is my account.ts

```auto
import { Component } from '@angular/core';
import { NavController } from 'ionic-angular';

@Component({
  selector: 'page-account',
  templateUrl: 'account.html'
})
export class AccountPage {

  constructor(public navCtrl: NavController) {

  }

}

```

In tabs.ts I also have import and I have the same for all 3 pages, including AccountPage as you can see above. All Import I don’t see any HomePage reference in the code and no Home. Also I wonder why I don’t get any error when running the application, maybe it is using a “previously built” version?

---

<div class="post-metadata">

**Author:** ![lucasbasquerotto](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/lucasbasquerotto/32/101719_2.png) [@lucasbasquerotto](https://forum.ionicframework.com/u/lucasbasquerotto)\
**Post date:** [May 7, 2018, 8:33pm UTC](https://forum.ionicframework.com/t/rename-a-tab-title-in-an-ionic-project/129922/4 "2018-05-07T20:33:40Z")

</div>

You said you have the following error/warning:

> [@IAmos](#):
>
> [Angular] Component ‘AccountPage’ is not included in a module and will not be available inside a template. Consider adding it to a NgModule declaration

So, the `AccountPage` is imported in the `AppModule`. Is it used there?

```auto
@NgModule({
    entryComponents: [
        AboutPage,
        ContactPage,
        AccountPage,
        TabsPage,
    ],
    //...
})
export class AppModule { }

```

Delete the `www` folder and run `ionic serve` to see if everything works.

---

<div class="post-metadata">

**Author:** ![IAmos](https://avatars.discourse-cdn.com/v4/letter/i/a587f6/32.png) [@IAmos](https://forum.ionicframework.com/u/IAmos)\
**Post date:** [May 7, 2018, 9:02pm UTC](https://forum.ionicframework.com/t/rename-a-tab-title-in-an-ionic-project/129922/5 "2018-05-07T21:02:44Z")

</div>

> Is it used there?

Not sure what do you mean by that. I have this code in app.module.ts

```auto
@NgModule({
  declarations: [
    MyApp,
    AboutPage,
    ContactPage,
    AccountPage,
    TabsPage
  ],
  imports: [
    BrowserModule,
    IonicModule.forRoot(MyApp)
  ],
  bootstrap: [IonicApp],
  entryComponents: [
    MyApp,
    AboutPage,
    ContactPage,
    AccountPage,
    TabsPage
  ],
  providers: [
    StatusBar,
    SplashScreen,
    {provide: ErrorHandler, useClass: IonicErrorHandler}
  ]
})

```

> Delete the www folder

I searched for www inside my project folder and saw several www folders in several locations, which one should I delete?

---

<div class="post-metadata">

**Author:** ![lucasbasquerotto](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/lucasbasquerotto/32/101719_2.png) [@lucasbasquerotto](https://forum.ionicframework.com/u/lucasbasquerotto)\
**Post date:** [May 7, 2018, 9:21pm UTC](https://forum.ionicframework.com/t/rename-a-tab-title-in-an-ionic-project/129922/6 "2018-05-07T21:21:32Z")

</div>

I asked if it is used there because you posted:

> [Angular] Component ‘AccountPage’ is not included in a module and will not be available inside a template. Consider adding it to a NgModule declaration

Are you still receiving the error above? (you shouldn’t receive if the page is included in the `AppModule`)

Delete the `www` folder in the root of your project (where is your `package.json` and `config.xml` files).

Then run `ionic serve` and see what happens.

---

<div class="post-metadata">

**Author:** ![IAmos](https://avatars.discourse-cdn.com/v4/letter/i/a587f6/32.png) [@IAmos](https://forum.ionicframework.com/u/IAmos)\
**Post date:** [May 8, 2018, 8:17am UTC](https://forum.ionicframework.com/t/rename-a-tab-title-in-an-ionic-project/129922/7 "2018-05-08T08:17:24Z")

</div>

After deleting the www folder as you explained and running ionic serve, I see Account as expected but

1. Inside vscode, I still see a red line under @component with the same error as above
2. Is that mean I will need to do the above every time I make a change?

Thanks!

---

<div class="post-metadata">

**Author:** ![IAmos](https://avatars.discourse-cdn.com/v4/letter/i/a587f6/32.png) [@IAmos](https://forum.ionicframework.com/u/IAmos)\
**Post date:** [May 8, 2018, 8:34am UTC](https://forum.ionicframework.com/t/rename-a-tab-title-in-an-ionic-project/129922/8 "2018-05-08T08:34:20Z")

</div>

In order to check it, I renamed About to something else just like I did with Home -\> Account. I made all the changes from inside vscode itself.

I got the same problem. I then ran ionic serve and things worked (also from inside vscode) but the errors were still there in vscode. I closed vscode and re-open it. All errors are gone.

Shouldn’t it be more automatic? Am I missing something here?

---

<div class="post-metadata">

**Author:** ![lucasbasquerotto](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/lucasbasquerotto/32/101719_2.png) [@lucasbasquerotto](https://forum.ionicframework.com/u/lucasbasquerotto)\
**Post date:** [May 8, 2018, 11:51am UTC](https://forum.ionicframework.com/t/rename-a-tab-title-in-an-ionic-project/129922/9 "2018-05-08T11:51:29Z")

</div>

@IAmos I don’t have the red line under component even if I don’t include it in a module . It won’t work, though, but no error in VSCode.

Are you using some plugin to check angular templates or something like that. I remember I had some similar errors about that when I installed a plugin to check variables in templates, it had some errors and took some time to update the errors (when there were no more errors).

You can check if you have specific angular plugins in VSCode, disable them and see if it solves the issue. I think that is not related to VSCode itself.

You can open an issue in the plugin github repository (assuming there is one) stating your problem.

---

<div class="post-metadata">

**Author:** ![IAmos](https://avatars.discourse-cdn.com/v4/letter/i/a587f6/32.png) [@IAmos](https://forum.ionicframework.com/u/IAmos)\
**Post date:** [May 8, 2018, 2:59pm UTC](https://forum.ionicframework.com/t/rename-a-tab-title-in-an-ionic-project/129922/10 "2018-05-08T14:59:25Z")

</div>

I have several plugins that seem to be coming with vscode, how can I know which of them can be the problematic one?

What about the project not being updated until I delete the www folder and run ionic serve?

Thanks!

---

<div class="post-metadata">

**Author:** ![lucasbasquerotto](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/lucasbasquerotto/32/101719_2.png) [@lucasbasquerotto](https://forum.ionicframework.com/u/lucasbasquerotto)\
**Post date:** [May 8, 2018, 6:03pm UTC](https://forum.ionicframework.com/t/rename-a-tab-title-in-an-ionic-project/129922/11 "2018-05-08T18:03:39Z")

</div>

@IAmos I don’t know 😕 Probably one related with angular. Like [Angular Language Service](https://github.com/angular/vscode-ng-language-service) or something like that.

Perhaps your problem is similar to [this](https://github.com/angular/vscode-ng-language-service/issues/249).

Is the project not updated (the page that is shown in your browser) until you delete the folder and run again or just the errors in the editor? If it’s the 2nd then it must be a plugin like I said before. If the page in the browser is not updated I don’t know. Sometimes that happens to me when I change html files, but in most cases it works fine.

If the problem persists you could open an issue in the [ionic-app-scripts](https://github.com/ionic-team/ionic-app-scripts) or in the [ionic-cli](https://github.com/ionic-team/ionic-cli) repository.

---

<div class="post-metadata">

**Author:** ![IAmos](https://avatars.discourse-cdn.com/v4/letter/i/a587f6/32.png) [@IAmos](https://forum.ionicframework.com/u/IAmos)\
**Post date:** [May 8, 2018, 6:29pm UTC](https://forum.ionicframework.com/t/rename-a-tab-title-in-an-ionic-project/129922/12 "2018-05-08T18:29:19Z")

</div>

It looks like the 2 problems are not related.

Even when the application runs ok with the new titles (after deleting www folder and running "ionic serve) the errors are still there. Only closing/opening vscode removes them. I didn’t try just closing/opening the specific file but I added my comment to the question you linked to. No one answered there so I hope someone will notice it eventually.

Btw, how can I know if the problem is related to ionic or vscode? I posted a question about it in vscode just now but I wonder if this was the right place.

Thank you very much for your patience and help.

---

<div class="post-metadata">

**Author:** ![lucasbasquerotto](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/lucasbasquerotto/32/101719_2.png) [@lucasbasquerotto](https://forum.ionicframework.com/u/lucasbasquerotto)\
**Post date:** [May 8, 2018, 6:56pm UTC](https://forum.ionicframework.com/t/rename-a-tab-title-in-an-ionic-project/129922/13 "2018-05-08T18:56:03Z")

</div>

First, I advise to disable all your plugins and see if it works.

If it works, try to enable the angular plugins one by one to see when the error happens (it seems it is because of a plugin, `@Component()` is not `VSCode` nor `Typescript` specific, but `Angular` specific).

---

<div class="post-metadata">

**Author:** ![IAmos](https://avatars.discourse-cdn.com/v4/letter/i/a587f6/32.png) [@IAmos](https://forum.ionicframework.com/u/IAmos)\
**Post date:** [May 8, 2018, 7:08pm UTC](https://forum.ionicframework.com/t/rename-a-tab-title-in-an-ionic-project/129922/14 "2018-05-08T19:08:02Z")

</div>

Actually the errors I see, less bother me, I’m more concerned about the need to delete www folder and run ionic serve for any change I make. To which part this belongs?

---

<div class="post-metadata">

**Author:** ![IAmos](https://avatars.discourse-cdn.com/v4/letter/i/a587f6/32.png) [@IAmos](https://forum.ionicframework.com/u/IAmos)\
**Post date:** [May 8, 2018, 7:28pm UTC](https://forum.ionicframework.com/t/rename-a-tab-title-in-an-ionic-project/129922/15 "2018-05-08T19:28:27Z")

</div>

I now added a card component.  
I ran Simulate Android in browser, the browser opened up but I didn’t see the card component.  
I ran ionic serve (inside the terminal) and a new browser opened up and there I did see the card component.  
I then closed the new browser and moved to the browser that opened up previously and guess what? The component was there as if it “reloaded” itself… something looks wrong with the automatic “build” of my changes and only a manual ionic serve does the trick.

Just before posting this, I changed the card to a select component and guess what? Now the changes are immediate… this is confusing.

---

<div class="post-metadata">

**Author:** ![lucasbasquerotto](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/lucasbasquerotto/32/101719_2.png) [@lucasbasquerotto](https://forum.ionicframework.com/u/lucasbasquerotto)\
**Post date:** [May 9, 2018, 12:01pm UTC](https://forum.ionicframework.com/t/rename-a-tab-title-in-an-ionic-project/129922/16 "2018-05-09T12:01:39Z")

</div>

I can’t say much about that, if you think there is an issue it’s better to open a new issue in the cli or app-scripts repo expaining the steps to reproduce.

I use live reload when I ran ionic serve only.

If you **only** run `ionic serve`, then change a file, the browser is reloaded and you see the change? (without closing the browser)

---

<div class="post-metadata">

**Author:** ![IAmos](https://avatars.discourse-cdn.com/v4/letter/i/a587f6/32.png) [@IAmos](https://forum.ionicframework.com/u/IAmos)\
**Post date:** [May 9, 2018, 5:45pm UTC](https://forum.ionicframework.com/t/rename-a-tab-title-in-an-ionic-project/129922/17 "2018-05-09T17:45:56Z")

</div>

The problem seems to happen only with “Simulate Android in browser”  
{  
“name”: “Simulate Android in browser”,  
“type”: “cordova”,  
“request”: “launch”,  
“platform”: “android”,  
“target”: “chrome”,  
“simulatePort”: 8000,  
“livereload”: true,  
“sourceMaps”: true,  
“cwd”: “${workspaceRoot}”  
},  
liveReload is true, is there something else I’m missing?  
When working run browser then it seems to work ok.  
Does it change the place you told me to post this question on? Can you give me a link to the proper place?  
Thanks!

---

<div class="post-metadata">

**Author:** ![lucasbasquerotto](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/lucasbasquerotto/32/101719_2.png) [@lucasbasquerotto](https://forum.ionicframework.com/u/lucasbasquerotto)\
**Post date:** [May 9, 2018, 5:58pm UTC](https://forum.ionicframework.com/t/rename-a-tab-title-in-an-ionic-project/129922/18 "2018-05-09T17:58:23Z")

</div>

@IAmos I never tried to simulate android in browser, only in device and emulator (with `ionic cordova run android`). Maybe someone else might know about that.

---

<div class="post-metadata">

**Author:** ![IAmos](https://avatars.discourse-cdn.com/v4/letter/i/a587f6/32.png) [@IAmos](https://forum.ionicframework.com/u/IAmos)\
**Post date:** [May 9, 2018, 6:54pm UTC](https://forum.ionicframework.com/t/rename-a-tab-title-in-an-ionic-project/129922/19 "2018-05-09T18:54:02Z")

</div>

It looks like no one else is reading/answering 🙂

You wrote something about cli or app-scripts repo, do you mean on github?  
Now that we know where the problem is, to which “part” is it belong to? cordova, angular, ionic, something else?  
Again, thank you very much for your help and patience

---

<div class="post-metadata">

**Author:** ![lucasbasquerotto](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/lucasbasquerotto/32/101719_2.png) [@lucasbasquerotto](https://forum.ionicframework.com/u/lucasbasquerotto)\
**Post date:** [May 9, 2018, 8:34pm UTC](https://forum.ionicframework.com/t/rename-a-tab-title-in-an-ionic-project/129922/20 "2018-05-09T20:34:00Z")

</div>

Where did you see the information about “Simulate Android in browser”? Is that in cordova? It seems like some json configuration, where did you read about it?

I did some search and found:

> **[Microsoft/cordova-simulate](https://github.com/Microsoft/cordova-simulate)**
>
> cordova-simulate - Simulates your Apache Cordova application in the browser.

Is this what you are using?

If it is, your problem is probably not related to ionic or cordova itself, but to this tool.

You could create a new issue there, in the git repo.

Also, if this is your problem, then that explains why you don’t have the live reload.

Your files are in the `src/` folder and when you change 1 file the `ionic serve` detects the change and send to the `www/` folder.

The `www/` folder is the cordova folder and this is the folder that is used by cordova when building the project. I think that the tool you are using detect changes to the **www** folder and reload the app.

The problem is that **your changes are in the `src`** folder.

One possible solution that I think is running the android simulation in 1 cmd, and `ionic serve` in another, so that `ionic serve` updates the `www` folder and the tool you are using detect the change.

[Next page](https://forum.ionicframework.com/t/rename-a-tab-title-in-an-ionic-project/129922.md?page=2)
