Quantcast
Channel: Ionic Forum - Latest topics
Viewing all articles
Browse latest Browse all 70612

Global ion-nav-view (solved!)

$
0
0

@DutchKev wrote:

How can i 're-use' the same ion-nav-view, between different pages?

Let say I have a stateProvider

$stateProvider
  .state('home', {
    url: '/',
    views: {
      '': {
        templateUrl: 'template/home.html',
        controller: 'homePageController'
      }
    }
  })
  .state('messageList', {
    url: '/messageList',
    views: {
      messageOverview: {
        templateUrl: 'template/messageOverview.html',
        controller: 'messageOverviewController'
      }
    }
  });

When I do this:

$state.go('messageList');

It expects another ion-nav-view

So I end up having this:

<ion-nav-view name=""></ion-nav-view>
<ion-nav-view name="messageList"></ion-nav-view>

But the bad thing is it doesn't really 'replace' the old view.. When you have a lot of pages, it would get a huge DOM, what slows things down..

So is it by design? Or does anybody know the correct way?

Many thanks!

Posts: 2

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 70612

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>