Quantcast
Channel: Ionic Framework - Ionic Forum
Viewing all articles
Browse latest Browse all 49188

Using components as templates in ui router conflicts with nav bar

$
0
0

@anmolarora wrote:

Hello Everyone

I just noticed a problem with ion-nav-bar which appears when using directives as templates with ui router. Being precise, when using state router as -

      .state('tab.home', {
        url: '/home',
        views: {
          'tab-home': {
            template: '<home></home>'
          }
        }
      })

Where is a reusable compnent/directive with it's own ion-view and ion-components.

angular.module('myapp.Directives').directive("home",[function () {
    return {
        restrict: "E",
        replace: true,
        templateUrl: 'views/home.html',
        scope: {
        },
        bindToController: {
        },
        controllerAs: "shiftCtrl",
        controller: function ($scope) {
            //controller code here
        }
    }
}])

Everything seems to be working fine until I use or in the definition of 'home.html' because these don't work at all. However, when I define state like -

  .state('tab.home', {
    url: '/home',
    views: {
      'tab-home': {
        templateUrl: 'views/home.html',
        controller: 'HomeCtrl'
      }
    }
  })

The nav buttons and nav title work fine in this case.
I have tried a couple of tweaks but none of them seems to work. Can someone please help me fixing this issue?

Thanks

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 49188

Trending Articles



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