2,439 questions
3 votes
1 answer
76 views
Are there differences in how angular's @for and ngFor handle change detection?
I've used ngFor for many years now, but have been interested in transitioning over to the newer @for as it seems to make the code a little cleaner (in my opinion). However recently I just discovered ...
2 votes
1 answer
167 views
Angular - bootstrap carousel - How to bind active item
How to achieve this : When I click on right arrow of the carousel, I want to trigger a method with the item index as parameter. Some thing like <button ... (...)="eventHandler(index)" .....
1 vote
1 answer
65 views
Only use two way bind inside ngFor with index?
I want to bind an array of objects to inputs using *ngFor. Is it necessary to use the index property to get a stable behavior or the following code would work without causing trouble? <div *ngFor=&...
1 vote
2 answers
69 views
*ngFor not displaying an array of objects in angular using Typescript
I cannot seem to figure this one out even in searching all the answers for this issue. I have tried using a table, ul and div and nothing seems to be able to show the values of the json object that I ...
1 vote
2 answers
73 views
Angular @input and @Output conflict
I made a directive in angular which is act as a time input and in template of component I repeated it based on an array of string. The directive has an @Input that is the initial value which is set to ...
1 vote
1 answer
28 views
Render Nested objects value in html using Angular ngFor directive
I have an Object with nested object. I am trying to display in html using ngFor directive of Angular. But I got the result as multiple time. Below my object productlists = [ { productname: '...
-1 votes
2 answers
147 views
How to get checked checkbox vaule inside ngFor/ngIf?
I have data like so: const List: Array<Item> = [ { id: 1, name: 'somename' } ... ] Then html looks like this: <ng-container *ngFor="let item of list; let i = index;"&...
1 vote
1 answer
73 views
How to use unique reference in a loop
With Angular I am using this date time picker in loop and I need to assign a unique reference. So far I hardcode it to req_d1 but it creates some problem. I would like to know how could I set a ...
1 vote
1 answer
80 views
How to combine string and array in string interpolation of ngfor in Angular
I have an array of objects, I would like to combine a string and an array while showing in ngfor iteration. temp: [ { "value1": "as", "value2": "[a, b, c, ...
1 vote
1 answer
97 views
Search working only on the current page in Angular 17
This search function is searching only from the shown page. If I'm on page1, it searches only on page1; Likewise, if I'm on page2, it searches only on page2. What changes do I need to do to fix this? ...
0 votes
2 answers
78 views
Passing data to the child component through loop Angular
I need to pass data from array in parent component to child component and for every element in array create child component with passing data in it. That's my parent component: @Component({ selector:...
0 votes
1 answer
119 views
Sum for ngFor item using Angular 17
I am displaying data in a ngFor repeat. Here's my JSON: { "status": "success", "data": [ { "_id": "668aaab4d4f3277010802ad9&...
1 vote
3 answers
80 views
How to add object values from an array of multiple objects into an array readable for ngFor?
I get an array like this: obj_Array = [{"Information":{ID: 1, Name: "Frank"}},"Route":{Direction: "north", Time: 10:50:24},"Music":{volume: "loud&...
2 votes
1 answer
76 views
How to I create a Mat-Step with for loop which has individual components inside?
I have around 20 forms created as difference components and implemented with mat-stepper as below <mat-step> <form [formGroup]="form1"> <component1></...
5 votes
2 answers
403 views
Why is this *ngFor loop rendering the data twice?
I have an NG Bootstrap Accordion element that, when open, displays a list of contact cards. For some reason the list of contacts output by the ngFor is duplicated and renders twice. The data is not ...