title: Test if an object is an empty object in a AngularJS template
body: <p>I have a simple object in a controller which can sometimes be empty (<code>{}</code>).</p>
  
  <pre><code>app.controller('TestController', function() {
    var vm = this;
  
    vm.testObject = {};
  });
  </code></pre>
  
  <p>I want to hide or show some DOM-elements in the corresponding template when the object is empty or not.</p>
  
  <p>I tried to do it with a simple <code>&lt;div ng-if="vm.testObject"&gt;</code> but when <code>vm.testObject === {}</code> it is considered <code>true</code> in the <code>ng-if</code>.</p>
  
  <pre><code>&lt;div ng-controller="TestController as vm"&gt;
    &lt;div ng-if="vm.testObject"&gt;
      Test Object is not empty
    &lt;/div&gt;
    &lt;div ng-if="!vm.testObject"&gt;
      Test Object is empty
    &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>Is there a simple way to check for an empty object in the template? Preferably without adding new variables to the scope.</p>
  
  <p>Here is a working Plunker:
  <a href="http://plnkr.co/edit/Qed2MKmuedcktGGqUNi0?p=preview">http://plnkr.co/edit/Qed2MKmuedcktGGqUNi0?p=preview</a></p>