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

Router state views based on platform

$
0
0

@zarcode wrote:

I am trying to show different views based on platform, we can say "dinamic views parameter", something like this:

.state('tabsController.topics', {
  url: '/topics',
  views: function(){
    if(ionic.Platform.isAndroid()) {
      return {
          'menuContent': {
            templateUrl: 'templates/topics.html',
            controller: 'topicsCtrl'
          }
      }
    } else {
      return {
        'tab1': {
          templateUrl: 'templates/topics.html',
          controller: 'topicsCtrl'
        }
      }
    }

  }
})

Anyone knows whats wrong with this code. Seams return value is not good. Need it to show tabs on ios and sidemenu on android.

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>