-1

I want to use ngFor to create a dropdown menu depending on my object key. For example

Component.ts

Drop_Down_Menu={1:[1,2,3],2:[3,4,5],3:[4,5,6]}

Component.html

<ng-container *ngFor="let item of Drop_Down_Menu[1]">
    <Label class="donation-label">{{item.value}}</Label>
</ng-container>

my intended output should be a drop-menu with values

1
2
3

Currently

I am getting

1,2,3

all in one row instead of in their own rows

Darius
  • 69
  • 9

1 Answers1

-1
<div class="dropdown-menu">
                    <ng-container *ngFor="let item of Drop_Down_2_Stuff | keyvalue">
                        <div *ngIf="item.key==1">
                            <div *ngFor="let stuff of item.value">
                                {{stuff}}
                            </div>
                        </div>
                    </ng-container>
                </div>

@Rihabh thanks

Darius
  • 69
  • 9