Skip to content

Instantly share code, notes, and snippets.

@PatrickJS
Created September 25, 2013 18:06
Show Gist options
  • Select an option

  • Save PatrickJS/6703570 to your computer and use it in GitHub Desktop.

Select an option

Save PatrickJS/6703570 to your computer and use it in GitHub Desktop.
remove $$hashkey from Angular ng-repeat
<ul>
<li ng-repeat="thing in things track by $id($index)">
.....
</li>
</ul>
or
<script>
JSON.stringify(value, function (key, val) {
if (key == '$$hashKey') {
return undefined;
}
return val;
});
</script>
@grabbou

grabbou commented Oct 7, 2014

Copy link
Copy Markdown

angular.toJson() is enough.

@BrainCrumbz

Copy link
Copy Markdown

or, if available, something like ng-repeat="thing in things track by thing.someUniqueIdField"

@imwangji

imwangji commented Aug 3, 2018

Copy link
Copy Markdown

angular.toJson() is enough.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment