0

So I doing a course in Angular and I've stumbled across an instructor who is showing how to use the ng-show directive in an example. See code below:

Name: {{ user.name }} <br /><br />
<div ng-show='!!user.address'>Address:<br />
  {{user.address.street}} <br />
  {{user.address.city}}<br />
  {{user.address.planet}}
</div>

The question is, why does the instructor use two exclamation marks instead of one to hide address?

For further reference purposes, I include the script.js file:

angular.module('app').controller('mainCtrl', function($scope) {
  $scope.user = {
    name: 'Luke Skywalker',
    address: {
      street: 'PO Box 123',
      city: 'Secret Rebel Base',
      planet: 'Yavin 4'
    },
    friends: [
      'Han',
      'Leia',
      'Chewbacca'
    ]
  }
});
Mike. D
  • 2,093
  • 4
  • 26
  • 50

0 Answers0