Last active
November 28, 2016 17:37
-
-
Save sheva29/87b45244ad65170bf4638b6fc2fb742a to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* when trying to console.log in Angular */ | |
JSON.stringify($scope, function(key, value) { | |
if (typeof value === 'object' && value !== null) { | |
if (cache.indexOf(value) !== -1) { | |
// Circular reference found, discard key | |
return; | |
} | |
// Store value in our collection | |
cache.push(value); | |
} | |
return value; | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment