Ionic 3 - a tag href internal link

jonwa Source

So I'm new to Ionic and Angular and I had a question regarding internal links within the Ionic framework. So as a learning base I made the pre-made project ionic sidemenu and I'm trying to get an A tag on the home page to be linked (href) to open the list page. However, I cannot figure it out because I keep getting errors.

Something like:

<a button href="../list/list.html"></a>

But the href isn't working because I think you have to call /list/list as a package with typescript??

Does anyone know the solution?

angulartypescriptionic-frameworkionic3

Answers

answered 6 months ago Sampath #1

You're doing it wrong. Ionic has its own navigation system.So you need to use it to navigate one page to another or like so.

this.nav.push(listpage);

Please see the official doc for more info about navigation and NavController

answered 6 months ago jonwa #2

I figured it out! I know I'm answering my own question but just in case anyone else got stuck.

https://ionicframework.com/docs/components/#navigation

Make sure that the goToOtherPage() function is NOT in the constructor but only the export class in the typescript file.

comments powered by Disqus