Questions tagged [angular-ngfor]

45 questions
23
votes
4 answers

Angular: 'Cannot find a differ supporting object '[object Object]' of type 'object'. NgFor only supports binding to Iterables such as Arrays'

I've created an angular app which gets data from a json file. But I'm having issues with showing the data in html. A lot of variables are in dutch, I'm sorry for that. I'm also a bit new to all of this :) This is my service: import {Injectable} from…
Claire
  • 475
  • 1
  • 8
  • 21
5
votes
3 answers

Angular 6 ngFor list of tables grouped by key

My Angular 6 app needs to displays a list of tables, where a table is a group of chemical analyses of elements of its composition. Lets say I have a metal alloy A. I perform different compound analyses on it to find its chemical composition: Fe:…
Jim P.
  • 303
  • 1
  • 5
  • 15
3
votes
2 answers

How to insert divider in the `ngFor` in Angular?

I have a subsection and I'm wondering how I can place html divider between every subsection but not sure how to do that so I would be really appreciated if I can get any suggestion or help.
user9436741
3
votes
2 answers

How to write a custom data attribute for a 'mat-select' element in Angular Material 9

I'm trying to set a custom data attribute (data-tag) for a mat-select element in Angular Material 9. The following is the HTML and TS code that I'm using, but nothing happens by inspecting the webpage code into the browser: HTML:
3
votes
4 answers

Creating a list of checkboxes with ngFor Angular

I have a list of objects that's structured like this: [{item},{item},{item}] I'm trying to create a list of checkboxes with angular out of this list like this:
sander
  • 1,426
  • 4
  • 19
  • 46
2
votes
2 answers

How can I take the value of an in an *ngfor?

I have a table of variable length and in every cells I have an input(the default value of every input is 0), I need the user to edit the data that he wants, then when he press a button I need to have all the data back and the id of the input (the id…
pietro
  • 51
  • 8
2
votes
1 answer

Angular Select control ngFor is not working in table with results

I have this dataset for a table: I'm trying to populate a select control as part of html table with results. This is what I'm trying to do:
Laziale
  • 7,965
  • 46
  • 146
  • 262
2
votes
1 answer

How to hide unused items with ngFor ionic?

im trying to hide unused items from ngFor, the problem is, i did hide it successfully but its place still exists and empty like the image below: My ts file: coupon: any; couponz() { var data=[]; for (let co of this.shared.couponz){ …
1
vote
1 answer

How to use ngIf inside the ngFor correctly. (Angular)