Use page as both modal and page


#1

I have a tab layout with a map tab and a tab with boats and I wanna be able to use the map as a page and also use the map as a modal from the boat page I know its possible but is it gonna give me some problems?


#2

You can use like a did a mix of both for example, to create sub tabs you can use:

  • on the crontoller Segments see docs about segments
  • on the view, use *ngSwitch to switch between them

(i’m using Ionic 2).


#3

Why as a page and not as a component? My guess is that a custom component would be a better option for your needs.


#4

@jsanta Simply because on several use cases, you might not want users to go to another children sub sub page.


#5

“Ionic 2” is not an actual thing. I would appreciate it if people would stop using this phrase, as it perpetuates further confusion over the (admittedly confusing in the first place) versioning of Ionic’s various parts.


#6

@rapropos sorry to say I use it, mainly to diff and explain people it’s not V1 code, to be clearer.


#7

@rapropos but we talked about that topic once, i promice i won’t use V2 any more sorry.


#8

But is that @payt1400 use case?
Perhaps a component is enough to solve pay’s problem.


#9

@jsanta Because he needs child of a tab, I suggested some ideas on top of the topic.


#10

I ended up using the map page as a modal and made it use a ngif for the view. I was thinking about a component but I was mostly wondering if this solution would give me any problem and should seperate pages and modals.


#11

I want to have it as a modal because in my boat tab I have a list of coordinates and want to show the particularly position on the map without leaving the page. But i also need a map that shows all positions in a seperate page.