Why is there an action bar that says "HelloWorld" when using standard ng template? Unable to add any custom action bars in my own components


#1

I’ve created a project using the tns-template-hello-world-ng template, but I’ve noticed that there’s an ActionBar that I do not want. It says “HelloWorld” as the title. When I’m trying to add my own ActionBar in one of my page components, it’s not showing up, and I’m guessing that this HelloWorld titled ActionBar is at fault. I cannot find it anywhere in my code, the template in app.component.ts is changed to only a page-router-outlet instead of the previous ActionBar that was there. But even if I add an ActionBar now in the very same template file, it’s not showing up either or changing the title. What the hell is going on here?


#2

Hi.

When you create a new Angular project now like this:
tns create [projectname] --template tns-template-hello-world-ng

You get a NativeScript Angular project with proper Angular routing (https://angular.io/docs/ts/latest/guide/router.html).

In app.routing.ts you see routes for pages, the initial one is “” and will redirect to “/items”.
"/items" will load the ItemsComponent which is located in item/items.components.ts and html.
The content will be displayed beneath the .

However the the ActionBar title there is “My App”. “HelloWorld” isn’t in the project at all as a title.
Did you just spin up a new project or is it an exciting one?

Can you share it on Github?


#3

It seems to be picking the name of the src folder… Which in the previous case was HelloWorld, now I re-installed the project as native-app and now it says “nativeapp” in the action bar. I cannot change it no matter what.

I’m having some git issues right now so I can’t, but can you try to create a new project and use lazy loading for one of the routes and add an ActionBar inside the lazy loaded component template? Because now I managed to set the title if I put an action bar in the app.component.html file, but the one in lazy loaded module doesn’t work.


#4

I managed to get it up on github, here’s the link: https://github.com/andresfleat/native-app/tree/sprint1