A cleaner way is to add the angular equals method to the $ scope:
var test = angular.module('test',[]); test.controller('testCtrl', ['$scope', function($scope){ $scope.angularEquals = angular.equals; }
Then you can use the equals method in the template, for example:
<div ng-show="!angularEquals(foo,{})">{{bar}}</div>
source share