(Ionic beta 1.0.0) Navbar not show on screen


#1

I’ve forked this on Codepen: http://codepen.io/anon/pen/wGrBd?editors=101

I also search in ionic.bundle.js and found this in ionNavBar directive (line 35386):

    $scope.backButtonShown = false;
    $scope.shouldAnimate = true;
    $scope.isReverse = false;
    $scope.isInvisible = true;
    $scope.$parent.$hasHeader = true;
    $scope.$on('$destroy', function() {
      $scope.$parent.$hasHeader = false;
    });
    $scope.$watch(function() {
      return ($scope.isReverse ? ' reverse' : '') +
        ($scope.isInvisible ? ' invisible' : '') +
        (!$scope.shouldAnimate ? ' no-animation' : '');
    }, function(className, oldClassName) {
      $element.removeClass(oldClassName);
      $element.addClass(className);
    });

Is $scope.isInvisible always set to true? So the navbar cannot show on browser?
Maybe it has wrong in my html, but I’m not sure. Can someone tell me how to fix this?
Thank so much and sorry for my bad English!

Edit:

I read the ionic beta document again and found that we can control navbar directive by using $ionicNavBarDelegate

        $ionicNavBarDelegate.showBackButton(true);
        $ionicNavBarDelegate.showBar(true);

#2

Hi @shinaekwon2n,

The reason it isn’t showing is because you don’t have an <ion-view> wrapping your content.

The <ion-view> is what lets Ionic know you’ve got a new page in the navigation history. Try that and lemme know how it works.


#3

Thank for replied @andy!
I tried with the code in Ionic new document, but nothing change, maybe i wrong somewhere in html.
Codepen: http://codepen.io/anon/pen/KluGd/?editors=101
Nevermind, I deleted the ion-view tag and using the javascript code to define navbar, and everthing was ok, but I think using html is better. Hope you will look in the Codepen and show me my mistakes. Thank you!