6
文字列としてキーを含み、マップ反復として値を含むngForループマップを使用して反復する方法
私はAngular5を初めて使用し、typescriptに別のマップを含むマップを反復しようとしています。この種のマップの下を角度で繰り返す方法は、コンポーネントのコードです。 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); }); …