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.
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:
…

Riccardo Volpe
- 1,471
- 1
- 16
- 30
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){
…

user3371817
- 53
- 4
1
vote
1 answer
1
vote
1 answer
Restructure the display of instantiated elements in *ngFor
I am currently just adding randomized numbers to an array and displaying them to the user.
This is the real random…

Damien Garlinge
- 77
- 1
- 8
1
vote
1 answer
Angular list with generic component as list item
Suppose I have a "ParentComponent" that has a list of items (let's say taken as an input) and needs to render the elements in the list. I need this parent component to be reusable however and one of the customizations it would support would be…

Vee6
- 1,527
- 3
- 21
- 40
1
vote
4 answers
Angular: How to get object behind *ngFor DOM element without an event?
How do I access the object behind a dom element based by the id of the dom element or something else that does not involve an event?
for example I have:
arr1 = [{a:1, b:2}, {a:5, b:10}, {a:20, b:50}];

user3261212
- 391
- 2
- 15
1
vote
2 answers
How update *ngFor on updating array using observable and how to initialize observable on website load?
I have two components "cart" and "home". Here "home" component is displaying list of products and it is the first page of website. I want to update cart when someone add product to the cart using "cart" button. For that I have create a service using…

WTF tom
- 75
- 1
- 11
1
vote
1 answer
How to display multi dimensional array using ngFor?
I am displaying data using below Json. it's working fine up-to two array while displaying third inner array i am getting error.kindly please suggest me how can successfully retrieve it.

DharamChauhan
- 109
- 1
- 1
- 11
1
vote
2 answers