# Is there any difference in what the expression provided for ng-if and ng-show should be?

**URL:** <https://forum.ionicframework.com/t/is-there-any-difference-in-what-the-expression-provided-for-ng-if-and-ng-show-should-be/16522>\
**Category:** uncategorized\
**Created:** [January 28, 2015, 2:01pm UTC](https://forum.ionicframework.com/t/is-there-any-difference-in-what-the-expression-provided-for-ng-if-and-ng-show-should-be/16522 "2015-01-28T14:01:23Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Maketroli](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/maketroli/32/72294_2.png) [@Maketroli](https://forum.ionicframework.com/u/Maketroli)\
**Post date:** [January 28, 2015, 2:01pm UTC](https://forum.ionicframework.com/t/is-there-any-difference-in-what-the-expression-provided-for-ng-if-and-ng-show-should-be/16522/1 "2015-01-28T14:01:23Z")

</div>

I have an application running with Angular now I am having some issues with the `ng-show/hide` and `ng-if/switch`, the second case actually works properly, but I ask my self: why I am using `ng-if/switch` when everyone uses `ng-show/hide` to display/hide content?

here is my code:

```auto
    $scope.displayStraight = true;
    $scope.displayParlayRobin = true;
    $scope.displayParlayIfBet = true;
    $scope.displayParlayTeaser = true;
    $scope.showBetType = function(betType) {
      $ionicScrollDelegate.resize();
      $ionicScrollDelegate.scrollTop();
      $scope.displayStraight = false;
      $scope.displayParlayRobin = false;
      $scope.displayParlayIfBet = false;
      $scope.displayParlayTeaser = false;
      $timeout(function() {
        $scope[betType] = true;
      }, 150);

```

and here is some of the content in my HTML:

**ng-hide:**

```auto
    <div ng-hide="betSlip.length">
      <div>
        No picks yet
      </div>

```

**ng-if:**

```auto
    <div ng-if="displayStraight">
       <div>
         Straight Bet
       </div>

```

**2-**

```auto
     <ion-list ng-if="displayStraight">

```

I had this last one this way and wasn’t working as expected:

```auto
    <div ng-show="betSlip.length >= 1">

```

now I change it to:

```auto
    <div ng-if="betSlip.length >= 1">

```

and it works properly, so, what am I doing wrong with the `ng-show/hide` ? is there any issues with the performance by using `ng-if/switch` ? what do you recommend ?
