4

I have an array like this:

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",
    },

and so on here is the html template:

<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>

How do i set that second select dynamically by the constraints given in the array? Now it shows all of them not matched by the first selector.

Sireini
  • 4,142
  • 12
  • 52
  • 91
  • You can review the answers here: http://stackoverflow.com/questions/33700266/how-can-i-get-new-selection-in-select-in-angular-2/33703660 – Brocco Mar 23 '16 at 15:20
  • The answer is given here as well https://stackoverflow.com/questions/33700266/how-can-i-get-new-selection-in-select-in-angular-2 – Jerome Alburo Mengullo Jun 15 '17 at 14:56

0 Answers0