angular-ngfor

How to export or get LOCAL variables of a *ngFor loop OUTSIDE it in Angular (v9, Material)

流过昼夜 提交于 2020-04-17 22:53:52
问题 First steps in Angular (with Material at version 9). I'm creating a form with the following code: HTML: <mat-form-field> <mat-label>Course</mat-label> <mat-select [formControl]="subjectControl" [attr.data-tag-subjectSemester]="this.subjectControl.value ? this.subjectControl.value.trim() : '' [attr.data-tag-subjectName]="this.subjectControl.value ? this.subjectControl.value.trim() : '' (selectionChange)="onChange($event)" required > <mat-option>-- None --</mat-option> <mat-optgroup *ngFor="let

Angular 6 ngFor list of tables grouped by key

99封情书 提交于 2020-01-13 14:31:31
问题 My Angular 6 app needs to displays a list of tables, where a table is a group of chemical analyses of elements of its composition. Lets say I have a metal alloy A . I perform different compound analyses on it to find its chemical composition: Fe: 0.001%, Cu: 0.042%, etc. Here is my data source, which is only a typescript file with mocks import { Certificate } from './certificate'; export const CERTIFICATES: Certificate[] = [ { serie: '1050 AJ', ident: 'Fe', moy_certified: 0.297 }, { serie:

How to hide unused items with ngFor ionic?

梦想与她 提交于 2019-12-02 06:12:48
问题 im trying to hide unused items from ngFor, the problem is, i did hide it successfully but its place still exists and empty like the image below: My ts file: coupon: any; couponz() { var data=[]; for (let co of this.shared.couponz){ data.push({ code: co.code, coEmail: co.email_restrictions[0], expiry: co.date_expires }); this.coupon = data; console.log(this.coupon) }return data } my data provider: @Injectable() export class SharedDataProvider { public couponz; this.config.Woocommerce.getAsync(

How to hide unused items with ngFor ionic?

房东的猫 提交于 2019-12-02 02:12:08
im trying to hide unused items from ngFor, the problem is, i did hide it successfully but its place still exists and empty like the image below: My ts file: coupon: any; couponz() { var data=[]; for (let co of this.shared.couponz){ data.push({ code: co.code, coEmail: co.email_restrictions[0], expiry: co.date_expires }); this.coupon = data; console.log(this.coupon) }return data } my data provider: @Injectable() export class SharedDataProvider { public couponz; this.config.Woocommerce.getAsync("coupons/").then((data) => { this.couponz = JSON.parse(data.body); }); my html: <ion-list padding> <ion

Angular: 'Cannot find a differ supporting object '[object Object]' of type 'object'. NgFor only supports binding to Iterables such as Arrays'

狂风中的少年 提交于 2019-11-27 08:55:21
I've created an angular app which gets data from a json file. But I'm having issues with showing the data in html. A lot of variables are in dutch, I'm sorry for that. I'm also a bit new to all of this :) This is my service: import {Injectable} from '@angular/core'; import {Http, RequestOptions, Response, Headers} from '@angular/http'; import {Observable} from "rxjs"; import {Afdelingen} from "./models"; @Injectable() export class AfdelingService { private afdelingenUrl = '/assets/backend/afdelingen.json'; constructor(private http: Http) { } getAfdelingen(): Observable<Afdelingen[]> { return

Angular: &#39;Cannot find a differ supporting object &#39;[object Object]&#39; of type &#39;object&#39;. NgFor only supports binding to Iterables such as Arrays&#39;

落花浮王杯 提交于 2019-11-26 14:22:42
问题 I've created an angular app which gets data from a json file. But I'm having issues with showing the data in html. A lot of variables are in dutch, I'm sorry for that. I'm also a bit new to all of this :) This is my service: import {Injectable} from '@angular/core'; import {Http, RequestOptions, Response, Headers} from '@angular/http'; import {Observable} from "rxjs"; import {Afdelingen} from "./models"; @Injectable() export class AfdelingService { private afdelingenUrl = '/assets/backend