Skip to content

Commit

Permalink
Add track to all @for loops
Browse files Browse the repository at this point in the history
  • Loading branch information
mraible committed Nov 21, 2023
1 parent 79fe5c4 commit 6661d8a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<ion-content class="ion-padding">
<ion-list>
@for (entity of entities) {
@for (entity of entities; track entity.name) {
<ion-item (click)="openPage(entity)">
<h2>{{entity.name}}</h2>
</ion-item>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@
<%_ if (otherEntityName === 'user') { _%>
<%_ if (relationshipType === 'many-to-many') { _%>
<div item-content>
@for (<%= relationshipFieldName %> of <%= entityInstance %>.<%= relationshipFieldNamePlural %>; let last = $last) {
@for (<%= relationshipFieldName %> of <%= entityInstance %>.<%= relationshipFieldNamePlural %>; track <%= relationshipFieldName %>.<%= otherEntityField %>; let last = $last) {
<span>
{{<%= relationshipFieldName %>.<%= otherEntityField %>}}{{last ? '' : ', '}}
</span>
Expand All @@ -98,7 +98,7 @@
<%_ } else { _%>
<%_ if (relationshipType === 'many-to-many') { _%>
<div item-content>
@for (<%= relationshipFieldName %> of <%= entityInstance %>.<%= relationshipFieldNamePlural %>; let last = $last) {
@for (<%= relationshipFieldName %> of <%= entityInstance %>.<%= relationshipFieldNamePlural %>; track <%= relationshipFieldName %>.<%= otherEntityField %>; let last = $last) {
<span>
<a>{{<%= relationshipFieldName %>.<%= otherEntityField %>}}</a>{{last ? '' : ', '}}
</span>
Expand Down

0 comments on commit 6661d8a

Please sign in to comment.