#I want render my size array in dropdown my array look like this at the moment

3 messages · Page 1 of 1 (latest)

tidal reef
#
[
    {
        "id": 4,
        "value": "Black",
        "sell_price": 1000,
        "cost_price": 400,
        "size": [
            {
                "id": 5,
                "value": "S"
            }
        ],
        "attachments": [
            {
                "id": 2,
                "product_attachment_details_attachments": {
                    "": 15
                }
            }
        ]
    },
    {
        "id": 4,
        "value": "Black",
        "sell_price": 1000,
        "cost_price": 400,
        "size": [
            {
                "id": 6,
                "value": "M"
            }
        ],
        "attachments": [
            {
                "id": 2,
                "product_attachment_details_attachments": {
                    "": 15
                }
            }
        ]
    }
]

i try this render this in this way but it showin error

<select [(ngModel)]="selectedSize">
 
  <option *ngFor="let product of filteredProducts ; let i=index" *ngFor="let size of product.size"
    [ngValue]="size.value">
    {{size.value}}</option>
</select>
red tree
#

You cannot use two structural directive on the same element.
And in the specific case, it makes little sense to iterate two times on an element.

#

You probably want two separate select bound to each other.
The first one letting the user select a product, and the second one letting him select a size for the selected product.