ngfor Questions
7
Solved
I'm working on a appointment booking app, where I'm displaying time slots for appointments using *ngFor to loop.
html
<div *ngFor="let item of allTimeSlots">
<div class="col-sm-3">
...
Stroller asked 22/7, 2017 at 15:13
2
Solved
I use an array to store a list of group objects and an array of a list of light objects.
I want to show the first group in the html and all connected lights to that group. After that the next group...
2
Solved
I have two nested *ngFor loops in Angular2. I want to maintain a counter that increments each time the code at the center of the loops is repeated.
The counter should go from 0 to the number of ad...
1
Solved
I had some confusion regarding ngTemplateOutletContext , specifically how it is passed to ngTemplate or who passes it to ngTemplate which surrounds the element on which *ngFor was applied. The conf...
Confetti asked 4/6, 2021 at 6:6
5
Solved
I'm trying to loop two arrays by using one *ngFor but it doesn't show any element on the browser. I have sample of HTML file below also initialized arrays in component file.
HTML file:
<tbo...
2
Solved
I'm using ionic 3, thus angular and typescript.
What I'm trying to achieve is to use the ngFor with a Map type.
Here is what I have:
interface IShared_Position {
lat: number;
lng: number;
time:...
Wallin asked 3/5, 2018 at 13:41
4
Solved
<li *ngFor="let year of paper?.years" class="list-group-item">
<div>
<a routerLink="/viewpdf/{{year.questionPaper.fileId}}">Question Paper - {{year.formattedYear }}</a>
...
Maribelmaribelle asked 3/1, 2018 at 6:45
5
Solved
How do I pass the current variable in an ngFor loop to ngIf, if it is using templates with then/else syntax?
It appears that they pass through fine when used inline, but aren't accessible from a t...
Rattly asked 11/1, 2018 at 10:11
1
I want to iterate a map and display the keys and values in my html file, for doing that I used Angular's *ngfor with keyvalue pipe.
However, there's an error with the ngFor iteration:
Argument typ...
Etna asked 25/6, 2020 at 22:35
4
Solved
I have encountered an issue where divs using routerLink get bordered with blue when clicked. I think I am missing something very obvious, possibly even a configuration I have in my browser or some ...
Athwart asked 16/4, 2017 at 17:21
1
Solved
I have an angular component that I want to use in a table with an ngFor but it breaks the table layout. My table looks like:
<table class="table table-stripped">
<thead>
<...
Unclassical asked 30/6, 2020 at 8:40
2
Solved
I am using Angular 4 with the bulma css framework and I am wondering how I can add a new row (or columns class) every third column.
The index variable which prints out 0,1,2 0,1,2 etc. was when I ...
6
Following is my Component:
import { Component } from 'angular2/core';
@Component({
selector: 'test',
template:
`
<ul >
<li *ngFor="let t of test">
<span >{{t}}</span&g...
Sight asked 14/6, 2016 at 21:21
3
Solved
So my goal is to create a mouseenter/mouseexit event for an individual li's child elements. For my app, when a user mouseenters an li elememt, it's child element div class='thumbs' is added to the ...
Verne asked 7/3, 2018 at 5:29
3
I have a simple generic component in Angular which receives a list of strings and creates a radio group for these strings:
@Component({
selector: 'radio-group',
templateUrl:
`<div *ngFor="...
Pegasus asked 24/1, 2017 at 9:33
2
Solved
Hello everyone here is a simplification of my problem
I created elements in my template using *ngfor
<table >
<thead>
<tr>
<th *ngFor="let item of array" > {{item}}<...
3
Solved
I was wondering if there is a way in angular2 to loop through an array or a list using *ngFor and skip the first or nth element
3
Solved
I would like to generate a grid based on unknown rows. The grid is simple with only two columns. One column containing row labels and the other some UI element such as a checkbox.
The only way I'...
4
Looks like something wrong with freight variable in HTML:
Error in app/freightList.component.html:13:8 Error trying to diff
'[object Object]'
Below is code
freight.service.ts
=============...
3
Solved
I'm at a loss. I can get horizontal scroll to work fine with just html and css but when i introduce ngFor, it refuses to produce the same effect.. Does anyone have experience with this, or know how...
Qualified asked 29/1, 2019 at 3:27
5
Solved
I've been digging around, and found out that I can use the following to use *ngFor over an object:
<div *ngFor="#obj of objs | ObjNgFor">...</div>
where ObjNgFor pipe is:
@Pipe({ n...
Caridadcarie asked 5/5, 2016 at 8:42
2
I am pretty new to Angular and I was wondering if there is any way to increment the ngFor loop by 2 instead of 1.
I am trying to implement two pagination's with in a pagination for which increment...
Collaborate asked 18/7, 2017 at 20:59
2
Solved
let's assume I have the following component:
@Component({
selector: 'todo-lib',
template: `
<li *ngFor="let todo of libService.todos">
<div class="view">
<label>{{todo.title}...
4
Solved
I am using Angular2 and its ngFor. I want to add class to odd and to even rows, so I can separate them visually by color.
Here is my code (which does not work really):
<div *ngFor="#meeting of...
5
when fetching json array object from rest api and trying to display in ngfor failed with the reason
error
EXCEPTION: Cannot find a differ supporting object '[object Object]' of type 'object'. NgF...
© 2022 - 2024 — McMap. All rights reserved.