Skip to content

Commit

Permalink
Adding if to validate if user send or no the list of columns
Browse files Browse the repository at this point in the history
  • Loading branch information
dlascarez committed Sep 21, 2023
1 parent 4276da6 commit f4a5598
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/angular-datatables.directive.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,11 +77,13 @@ export class DataTableDirective implements OnDestroy, OnInit {
}

// Set a column unique
resolvedDTOptions.columns.forEach(col => {
if ((col.id ?? '').trim() === '') {
col.id = this.getColumnUniqueId();
}
});
if (resolvedDTOptions.columns) {
resolvedDTOptions.columns.forEach(col => {
if ((col.id ?? '').trim() === '') {
col.id = this.getColumnUniqueId();
}
});
}

// Using setTimeout as a "hack" to be "part" of NgZone
setTimeout(() => {
Expand Down

0 comments on commit f4a5598

Please sign in to comment.