ngfor Questions

2

Solved

I would like to know if it is possible to create a dynamic HTML table from JSON data. The amount of columns and headers should change according to the keys in the JSON. For example this JSON should...
Sartain asked 26/3, 2018 at 12:54

1

Solved

I have a list of images in my page: <img *ngFor="let picture of pictures" [src]="picture.path"> The problem is that, every time I remove a picture, the previous list is recreated and all t...
Gallon asked 21/2, 2018 at 12:37

5

Solved

As per my understanding, Both are doing the same functions. But, ngFor would be works like as collections?. ngForOf would be works like as generics?. Is my understanding is correct? or Cou...
Calen asked 13/4, 2017 at 9:47

3

Solved

I'm looping through an array which has 6 objects and using ngFor where I want to loop only up to 4 elements .. How Can I do that?? <div class="item active" *ngFor="#data of lengthArray"> co...
Prothesis asked 30/6, 2016 at 12:8

2

Solved

I want to loop through an array of objects, which is in my json file. Json [ { "name": "Mike", "colors": [ {"name": "blue"}, {"name": "white"} ] }, { "name": "Phoebe", "colors": [ {"n...
Provincial asked 23/1, 2018 at 12:50

1

I am creating a small application, which display a list of People with Name, Surname and Age fields using ngFor. The application has search field, where one can enter a query, and then the list wil...
Darden asked 14/1, 2018 at 1:21

3

Solved

I have an array which contains other arrays inside like that: array = [ ["element A", "element B"], ["YES", "NO"] ] And I want to loop through this array of object in an HTML table using ngFo...
Advantageous asked 8/1, 2018 at 12:39

4

In my project I am getting data: image src, student name and student id. I bind student name and student id. How to bind image src in angular 2 ?
Venom asked 25/11, 2016 at 4:48

1

Solved

I've just started learning angular 4. This is a simple code that I'm trying to implement in Visual Studio Code, but keep getting this error. Uncaught Error: Template parse errors: Can't bind to 'n...
Brutus asked 28/12, 2017 at 16:18

6

Solved

I have a problem with filter in my JSON array when I move my app to Angular2 . In Angular 1.x that was easier. I used 'unique' in filter and this remove all duplicates. apps: {"app":"database_1",...
Aborticide asked 21/7, 2016 at 10:16

3

Solved

I have the following error from angular 2: EXCEPTION: Template parse errors: Parser Error: Unexpected token . at column 26 in [ngFor let button of modal.buttons] in ModalComponent@11:22 (""> &...
Skyway asked 26/5, 2016 at 10:21

1

Solved

Since recently, the Angular styleguide-lint-extender "Codelyzer" is throwing warnings when you do not have a trackBy-function implemented on every *ngFor. I am wondering why this is considered an i...
Greg asked 16/12, 2017 at 8:22

3

I'm trying to create a application with angular 2; I want when last element rendered in *ngFor,execute a function, something like this, tag is <img>: <img *ngFor="let image of template.p...
Elidiaelie asked 1/10, 2016 at 4:51

2

Solved

I am trying to tell whether an item in an *ngFor is the first or last element to style a container. Is there a way to do something like this? <md-expansion-panel *ngFor="let item of items" *ngC...
Lamelliform asked 25/10, 2017 at 10:40

3

I'm currently working on an angular app with an array of items (objects). I want to display each object in the array in its own list item, but want to limit the height of the list to 9 rows, before...
Terena asked 11/10, 2017 at 19:30

5

Solved

I'm trying to filter data table component based on the value passed by select drop down component.I'm using @Input() attribute but the selected dropdown data is not been passed to data table compon...
Coimbatore asked 7/9, 2017 at 6:34

2

Solved

In Angular 1.x this following code works as I want to to click and flip a card inside an ng-repeat <div class="card" ng-repeat="let card of cards"> <div class="flipcard" ng-class="{'flipp...
Cutthroat asked 25/7, 2016 at 10:12

1

I have this in my template: <input type="button" value="add" (click)="addEnvVar()"/> <div *ngFor="let envVar of application.env_vars"> <input type="text" name="key" [(ngModel)]="en...
Heffron asked 31/10, 2016 at 10:37

3

Solved

I'm trying to follow an example showing how to bind a class active to a component when it's clicked. When I execute the code based on the markup below <div *ngFor="let menu of menus;" [id]="me...
Gymnasiarch asked 21/8, 2017 at 7:56

1

Solved

I've got a whatsapp-like chat case of many types of messages that are needed to be displayed differently. Each has its' own component such as TextMessageComponent, FileMessageComponent, etc.. I...
Horologist asked 17/7, 2017 at 7:48

2

Solved

I just try to delete object from array in typescript, in angular 2.4.0, let me show the code, its my html file: button type="submit" (click)="addAnotherLanguague()" >Add non native languague&lt...
Differentiation asked 12/7, 2017 at 11:37

1

Solved

I'm pretty new in angular2 and I'm trying to make a small angular component called "grid" that simply rearranges its content using transclusion. Its template grid component template (grid.compon...
Arethaarethusa asked 15/6, 2017 at 10:17

4

Solved

I have a couple of *ngFor loops depending on iterables which might not be instantiated yet. (e.g. they are waiting for an observable) is there any expression like this I could use in the view? UP...
Rosewood asked 29/4, 2016 at 21:44

3

Solved

Yet very basic thing, but I am unable to figure out how to display array of strings in html template in angular2. .html <ul> <li *ngFor="#number of numberOptions"> {{number}} </...
Phytosociology asked 8/5, 2017 at 15:18

3

I'm trying to use the card group functionality of Bootstrap 4 with Angular ngFor. Here is the HTML I have for now, but I can't find how to break to a new line after 3 items have been inserted: &l...
Wolford asked 2/5, 2017 at 20:28

© 2022 - 2024 — McMap. All rights reserved.