ng2-material-select
ng2-material-select copied to clipboard
Glitches on latest angular build
trafficstars
Please look at: https://youtu.be/iES6UjFeuSY This shows that for some reason I can pick gender, but can't country or ages.
Also, not that the 'maximum age' has reverse() on it, but it is still shown normally?
Source code:
Gender: <br/>
<ng2-select [placeholder]="'Gender'"
[options]="lists.genders.data"
[displayBy]="'gender_name'"
[identifyBy]="'gender_id'"
[(ngModel)]="gender_id">
</ng2-select>
<br/>
<br/>
Age: <br/>
<ng2-select [placeholder]="'Minimum age'"
[options]="ages"
[(ngModel)]="age.min">
</ng2-select>
-
<ng2-select [placeholder]="'Maximum age'"
[options]="ages.reverse()"
[(ngModel)]="age.max">
</ng2-select>
<br/>
<br/>
Where: <br/>
<ng2-select [placeholder]="'Country'"
[options]="lists.countries.data"
[displayBy]="'country_name'"
[identifyBy]="'country_code'"
[(ngModel)]="country_code">
</ng2-select>
Hi @AmitMY,
I'm going to check this out :) It would help a lot if you could post here some of your component's code? Thanks
Thanks for caring! Latest Version of angular2. Can't supply the code, as it is a part of a big setup.
However, here is a similar-idea controller code:
class ExampleComponent {
ages: [];
lists: {
countries: {data: []},
genders: {data: []}
}
constructor() {
for(let i = 18; i < 100; i++)
ages.push(i);
// This is a socket response, so 100ms delay?
setTimeout(() => {
this.lists.countries.data.push({
country_code: "USa",
country_name: "United States of America",
});
this.lists.countries.data.push({
country_code: "UST",
country_name: "United States of Trump",
});
this.lists.genders.data.push({
gender_id: 1,
gender_name: "Male"
});
this.lists.genders.data.push({
gender_id: 2,
gender_name: "Female"
});
}, 100);
}
}
@Gbuomprisco Is this issue still relevant? (was this looked into)