[javascript] How to check for an empty object in an AngularJS view