I am creating an array in a variable in Ionic2 as:
allMonths = {'01':'January','02':'February','03':'March','04':'April','05':'May','06':'June','07':'July','08':'August','09':'September','10':'October','11':'November','12':'December'};
I want to get all months (with keys specified) i am displaying them in html as :
<ion-item>
<ion-select [(ngModel)]="allMonths">
<ion-option value="{{months.key}}" *ngFor = "let months of allMonths | keys">{{months.value}}</ion-option>
</ion-select>
</ion-item>
** Although i am getting response but the issue is i am getting as:
1st: October 2nd: November 3rd: December 4th: January . . . 12th: September
***** But i want them to be in series from jan to dec in popup.
Can any body suggest please where i am wrong.
Thanks in advance.
ngModelto the same variable that is the source (array). You have to create another variable and put it inngModel. Also iskeysapipe? If so, it would be better if you paste it here.