我有一个这样的数组:
export var EXPRESSIONCATALOG: ExpressionCatalogItem[] = [{
"selector" : "arrivalDate",
"selectorName": "Arrival date",
"constraints": ["GreaterThan", "LessThan", "Equals", "NotEquals"],
"valueType": "Date"
},
{
"selector": "departureDate",
"selectorName":"Departure Date",
"constraints": ["GreaterThan", "LessThan", "Equals", "NotEquals"],
"valueType": "Date",
},
等等是html模板:
<div class="container">
<div class="row" *ngFor="#expression of expressions;#expressionindex = index">
<div class="col-xs-3">
<select class="form-control" [ngModel]="expression.selectorName" >
<!--(ngModelChange)="onChange(expressionindex, $event)"-->
<option *ngFor="#c of catalog;#catalogindex = index" [value]="c.selectorName">
{{c.selectorName}}
</option>
</select>
</div>
<div class="col-xs-3">
<select class="form-control">
<option *ngFor="#constraint of catalog">
{{constraint.constraints}}
</option>
</select>
</div>
<!--<constraint></constraint>-->
</div>
<a class="btn btn-primary" (click)="newCondition()"><i class="glyphicon glyphicon-plus"></i></a>
</div>
如何通过数组中给出的约束动态设置第二个选择?现在它显示所有这些都与第一个选择器不匹配。