Questions tagged [ngfor]

The Angular NgFor directive instantiates a template once per item from an iterable.

0
votes
1answer
45 views

Issues with *ngFor and GridLayout in Nativescript

I have a problem with the grid layout. My code is this one: <GridLayout padding="10%"columns="auto, auto, auto, auto, auto, auto, auto" rows="*"> <ng-...
0
votes
3answers
56 views

Why is my ngFor always updating, but array is not

Problem is: When I start this component, my ngFor div always updates and my RAM becomes empty. As I know, ngFor updates when array is updated, but my array(announcements) update only once, in ...
0
votes
0answers
14 views

trackBy resets even though it shouldn't

I have the following code: this.swingCasesService.$positions.subscribe(swingPositions => { this.swingPositions = swingPositions } trackById(index: number, swingPosition: SwingPosition) { ...
1
vote
0answers
19 views

How to map non-input tags in html to individual iterations when using *ngFor directive in Angular during reverse routing?

I am facing a problem with *ngFor directive while reverse routing. I am using the loop to input certain employment details multiple times. I am posting code snippet here for example and the entire ...
0
votes
1answer
32 views

How to set dynamic index element using ngFor in Angular?

I'd want to handle dynamic attributes in NgFor Angular using an index. I have a similar set of properties/interfaces. vehicle1_Name, vehicle2_Name, vehicle3_Name vehicle4_Name, totalVehCount Like ...
0
votes
1answer
40 views

Property '<>' does not exist on type 'Component' Angular 12

I am passing an object 'customer$' through to my html file using an observable and async pipe. The object contains an array of addresses which I would like to use to create a list using *ngFor; ...
1
vote
1answer
34 views

Input loses focus when filtering an array, rendered using *ngFor and Clarity's Angular components

I have a list of users rendered using *ngFor. The user has the option to filter the list by typing the name in the input field. However, when the user starts typing to filter, the input field loses ...
-1
votes
0answers
38 views

Use ngFor into [innerHtml] content (Angular)

How to use the predefined Angular directive *ngFor into [innerHtml] content? Source Code: https://stackblitz.com/edit/angular-ivy-sbo28r?file=src%2Fapp%2Fapp.component.ts
0
votes
1answer
58 views

Angular card arrays with *ngfor

For my project that i am working on, i am using some card elements, i created an interface for the array with another array in it. The ts: categories: categorieCards[] = [ { title: 'animals',...
1
vote
1answer
40 views

Passing huge object from parent to child component

I am refactoring a code where I want to pass down several properties to a reusable child component -- but without using too many inputs (which is the current problem). The problem is that, even with ...
0
votes
1answer
31 views

ion-select using pipe transform, how to set default value?

I'm using pipe transform on <ion-select-option *ngFor="let item of collection | myPipe:someValueToFilter" [value]="item"> and the pipe will do some filter, map and sort. How ...
0
votes
1answer
44 views

How do I display an index change in ngFor (Angular)

I have a function called removePopUp. When I send an index sometimes I want to change whats inside that index in the array. Lets say I have an array of [0,1,2]. when I run removePopUp(1) that should ...
0
votes
0answers
31 views

ChartJS implementation in ngFor after data is subscribed from an API call

I was trying to implement doughnut charts individually for all the datasets that I am receiving from an API call in angular with the following code : demo.component.ts import { Component, OnInit } ...
0
votes
2answers
39 views

How can I use an ngFor directive inside ng-content?

I'm trying to display an array of items using an angular material expansion panel and it's not displaying anything. I know the expansion panel uses ng-content to project content into the panel ...
2
votes
2answers
37 views

Ngfor doesn't actualize on reloading page (Angular + RXJS)

Hi i'm building a chat app with angular for a school project i'm using firebase for my backend and i have an issue with my ngfor. For exemple if i reload the page i will see nothing unless i hover my ...

15 30 50 per page
1
2 3 4 5
146