43 questions
0 votes
0 answers
27 views
bug situation with Angular_Ng0303 *ngFor
I,ve been some days I started learning Angular, and now I'm having some troubles (here's the problem) when calling to the *ngForOf directive in a li, can someone help me? pd: In the trouble picture, ...
0 votes
1 answer
65 views
Max Stack Call Size when adding parent's tamplate into child's HTML template in Angular
This is the child's template: <div id="io-struct"> <div id="input-struct"> <h3>Degrees: <input type="number" [(ngModel)]="degrees&...
0 votes
1 answer
302 views
*NgIf block in Angular does not toggle with two event functions
I need to show and hidden(perfectly - totally clear to original state) block with images with two buttons. For this I tried to make this job with NgIf block and boolean variable, but it works only ...
1 vote
1 answer
410 views
How to use ngIf inside the ngFor correctly. (Angular)
<label for="bank_id">Bank</label> <select class="browser-default custom-select custom-select-sx col-md-12 mb-auto" (change)="selectedBank($event)"> ...
0 votes
2 answers
485 views
Cannot do ng for loop binding in angular 13
I would like to do an angular 13 looping to split data to one column when duplicate entries came from database now I got like this I Want like this <table class="custom-table"> <...
0 votes
2 answers
107 views
Applying an ngClass on only 1 element of a table in angular
In my table, I'm attempting to add a read more button to each row that has a paragraph. The button is displayed for each row, and when I click one, it operates concurrently for each row. Here is my ...
1 vote
1 answer
51 views
Restructure the display of instantiated elements in *ngFor
I am currently just adding randomized numbers to an array and displaying them to the user. <div *ngFor="let temp of randomIntArray; let i = index"> <div *ngIf="i ...
-2 votes
2 answers
3k views
how to pass json data into an array in angular
I want to pass json data that I get from an API into an array and display that information in my template and I don't know how to do that. this error apears on my console : my ts file : this.api....
0 votes
0 answers
141 views
*ngFor doesn't display second component without detectChanges()
I'm trying to display other component in my app with *ngFor. It doesn't render if I don't use detectChanges() in my method. Should it be like that? <button class="custom-button" (click)=&...
0 votes
1 answer
1k views
Angular / double nested ngFor only in a specific case
Hello a service is returning to me the available cards of a client like this: { "cards": [ { "id": "545451", "name": "Visa", ...
0 votes
0 answers
411 views
Angular - Dropdown list optimization
I have a drop down list and it's corresponding sub dropdown lists created by two *ngFors. Clicking on the main drop down list item toggles the display of its child/sub dropdown list, and clicking on ...
0 votes
1 answer
532 views
Best practices for nested async inside of ngFor?
Let’s say I have a list of cars: const cars: Array<{carId: number}> = [{carId: 1}, {carId: 2}]; And I render them in a template: <div *ngFor=“let car of cars”></div> Inside of that ...
2 votes
2 answers
1k views
How can I take the value of an <input> 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 ...
0 votes
1 answer
117 views
Angular ngIf working in a ngFor and I would like to understand why
I am coding a small angular app where the user choose a movie and add it to his favorite list. The favorite list is then displayed and each selected movie has a button to show/hide a div where the ...
2 votes
1 answer
3k views
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 ...