Arrays NgFor仅支持绑定到Iterables(如数组),同时使用数组创建下拉选择

Arrays NgFor仅支持绑定到Iterables(如数组),同时使用数组创建下拉选择,arrays,angular,Arrays,Angular,我在运行应用程序时遇到以下错误: 错误:找不到类型为“subLandscape”的不同支持对象“[object object]”。NgFor仅支持绑定到阵列之类的iTerable。 我在HTML中提到的subLandscape变量是一个数组,但它在与“ngFor”一起使用时抛出一个错误 HTML: 组成部分: import { Component, OnInit } from '@angular/core'; import { Standalone } from '../standalone';

我在运行应用程序时遇到以下错误:

错误:找不到类型为“subLandscape”的不同支持对象“[object object]”。NgFor仅支持绑定到阵列之类的iTerable。

我在HTML中提到的subLandscape变量是一个数组,但它在与“ngFor”一起使用时抛出一个错误

HTML:

组成部分:

import { Component, OnInit } from '@angular/core';
import { Standalone } from '../standalone';
import { StandaloneModel } from '../models/standalone.model';
import {MatTableModule, MatTableDataSource} from '@angular/material/table';

@Component({
  selector: 'app-standalone-form',
  templateUrl: './standalone-form.component.html',
  styleUrls: ['./standalone-form.component.css']
})
export class StandaloneFormComponent {
  public project: string[] = ['', 'appdev', 'apptest', 'appqa'];
public subLandscape: string[] = ['DEV', 'Testing', 'QA', 'UAT'];
  public dataCenter: string[] = ['PDC', 'SDC'];
public model = new SModel('', '', '', '', '', 0, '', '');

}

可能是因为它无法区分
subLandscape

#subLandscape=“ngModel”
和组件属性数组
公共subLandscape:string[]=['DEV','Testing','QA','UAT']。更改其中一个的名称应该可以解决问题,可能是因为它无法区分
子Landscape
#subLandscape=“ngModel”
和组件属性数组
公共subLandscape:string[]=['DEV','Testing','QA','UAT']。更改其中一个的名称可以解决问题

export class SModel {
  constructor (
    public description: string,
    public reasons: string,
    public projectName: string,
    public subLandscape: string,
    public centerdata: string,
    public nom: number,
    public size: string,
    public dbgh: string
  ) {

  }
}
import { Component, OnInit } from '@angular/core';
import { Standalone } from '../standalone';
import { StandaloneModel } from '../models/standalone.model';
import {MatTableModule, MatTableDataSource} from '@angular/material/table';

@Component({
  selector: 'app-standalone-form',
  templateUrl: './standalone-form.component.html',
  styleUrls: ['./standalone-form.component.css']
})
export class StandaloneFormComponent {
  public project: string[] = ['', 'appdev', 'apptest', 'appqa'];
public subLandscape: string[] = ['DEV', 'Testing', 'QA', 'UAT'];
  public dataCenter: string[] = ['PDC', 'SDC'];
public model = new SModel('', '', '', '', '', 0, '', '');

}