Iterieren über ngFor loop-Karte mit Schlüssel als string und Werte als map-iteration

Ich bin neu eckig 5 und versuchen zu Durchlaufen, die Karte mit einer anderen Karte, Typoskript.
Iterieren unten diese Art von anzeigen in Winkel -
unten ist der code für Komponente:

import { Component, OnInit} from '@angular/core';

@Component({
  selector: 'app-map',
  templateUrl: './map.component.html',
  styleUrls: ['./map.component.css']
})
export class MapComponent implements OnInit {
  map = new Map<String, Map<String,String>>();
  map1 = new Map<String, String>();

  constructor() { 


  }

  ngOnInit() {
    this.map1.set("sss","sss");
    this.map1.set("aaa","sss");
    this.map1.set("sass","sss");
    this.map1.set("xxx","sss");
    this.map1.set("ss","sss");


    this.map1.forEach((value: string, key: string) => {
      console.log(key, value);

    });


    this.map.set("yoyoy",this.map1);

  }



}

und seine Vorlage html :

<ul>
  <li *ngFor="let recipient of map.keys()">
    {{recipient}}
   </li>


</ul>

<div>{{map.size}}</div>

Iterieren über ngFor loop-Karte mit Schlüssel als string und Werte als map-iteration

github.com/angular/angular/issues/2246
was ist die Lösung, die ich möchte nicht konvertieren meiner map array
stackblitz.com/edit/angular-ifebvj?file=app%2Fapp.module.ts
danke, funktioniert sehr gut
wenn map = new Map<String, Map<String,String>>(); wie funktioniert es

InformationsquelleAutor Feroz Siddiqui | 2018-01-10

Schreibe einen Kommentar