Chapter 2: Debugging using the JSON filter

HTML

<script src="https://code.angularjs.org/1.3.2/angular.min.js"></script>
<div ng-app="myApp">
    <div ng-controller="Ctrl">
        <pre>{{ user | json }}</pre>
    </div>
</div>

JavaScript

angular.module('myApp', [])
.controller('Ctrl', function ($scope) {
    $scope.user = {
        id: 123,
        name: {
            first: 'Jake',
            last: 'Hsu'
        },
        temp: [{x:1},{x:2}],
        username: 'papatango',
        friend_ids: [5, 13, 3, 1, 2, 8, 21],
        // properties prefixed with $$ will be excluded
        $$no_show: 'Hide me!'
    };
});