ng2-material-select icon indicating copy to clipboard operation
ng2-material-select copied to clipboard

Glitches on latest angular build

Open AmitMY opened this issue 9 years ago • 3 comments
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>

AmitMY avatar Nov 08 '16 18:11 AmitMY

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

Gbuomprisco avatar Nov 08 '16 20:11 Gbuomprisco

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);
    }
}

AmitMY avatar Nov 09 '16 13:11 AmitMY

@Gbuomprisco Is this issue still relevant? (was this looked into)

AmitMY avatar Apr 06 '17 13:04 AmitMY