Skip to main content

All Questions

Tagged with
Filter by
Sorted by
Tagged with
0 votes
1 answer
781 views

Select a particular child component looped inside a ngFor in the parent

I have a list of mat-expansion-panels in below HTML. A user can add any number of panels by clicking the add button. Parent Component HTML <mat-accordion> <ng-container *ngFor=&...
ONE_FE's user avatar
  • 986
2 votes
1 answer
474 views

Ionic using multiple chart.js canvas in the same page

Does anyone have an example for using multiple canvas in the same page? I have something like this in the HTML: <div style="height: 138px" *ngFor="let item of listItems; let i = index"> &...
svha's user avatar
  • 51
1 vote
1 answer
114 views

ngAfterViewInit clicks only first button in array. Activates result of other subsequent array ElementRefs

From a custom component I have an ElementRef array to display images attached to received data in an *ngFor loop. Once the click event happens, all images display in one data card, and the other *...
RingaB's user avatar
  • 11
2 votes
1 answer
1k views

Angular 4 set the focus in the dynamic generated textbox using viewChildran

I have the dynamically generated textbox as below. <tr *ngFor="let item of data; let in=index"> <td> <input #unitNumber type="text" name="workPerformed-...
Muthukumar Marichamy's user avatar
2 votes
2 answers
6k views

Angular 6: get reference to Components created with *ngFor inside ng-container tag

I'using ng-container to iterate on a list and create components <ng-container *ngFor="let f of optionsList; let i = index;"> <!-- component--> <app-...
raffaeleambrosio's user avatar
6 votes
1 answer
4k views

Angular ViewChildren does not see all children from ngFor immediately

I have a strange behaviour of @ViewChildren corresponding to children components generated by ngFor. @ViewChildren query does not see element standing in array for a quite long time. All my code is in ...
Michał Lis's user avatar
5 votes
2 answers
7k views

Angular 5: Access element inner html from the component for dynamically generated elements

I have an angular component in my component I need to access the inner html of element. For this I am able to get this for single element using ViewChild with template ref. but in the ngFor when I ...
Khemraj's user avatar
  • 109
-1 votes
1 answer
627 views

Angular, Generate Tag with ngFor loop and get it with ViewChild

I have a problem... Actually I'm working on a grid I generated it, this part works. But now I need to retrieve the position and I would like to use viewChild with a tag Like below : Map.html: Map.ts:...
Chris's user avatar
  • 41
0 votes
0 answers
385 views

How to toggle a specific panel in an ngFor from the component.ts in angular2

A similar question was answered, but I cannot find out why the code is not working for me. I have a list of ngbpanels generated using ngFor. I need to expand/de-expand a specific panel according to ...
Donia Zaela's user avatar
0 votes
1 answer
2k views

how to loop through a div which contains multiple div using angular2

I have requirement where the user will be asked a series of questions from 1-5 and the questions will come in a loop like first the user answers first question and then clicks next to the next ...
user avatar