Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Possible bug in dropdown.ts: options override #27

Closed
Eduardo-M-Cavalcanti opened this issue Jul 12, 2016 · 4 comments
Closed

Possible bug in dropdown.ts: options override #27

Eduardo-M-Cavalcanti opened this issue Jul 12, 2016 · 4 comments

Comments

@Eduardo-M-Cavalcanti
Copy link

Eduardo-M-Cavalcanti commented Jul 12, 2016

As I could not run sm-dropdown having it installed via npm (#26), I tried to make it run "directly" using dropdown.ts. Then I verified that on dropdown setup, the "options" were overrriden. I could fix it with the following modification:

export class SemanticDropdownComponent implements AfterViewInit {
    @Input() class: string;
    @Input() title: string;
    @Input() items: Array<{}>;
    @Input() options: any = {};
    @Output() onChange: EventEmitter<string|number> = new EventEmitter<string|number>();
    @ViewChild("dropdown") dropdown: ElementRef;

    ngAfterViewInit(): void {
        this.options.onChange = (value: string|number) => this.onChange.emit(value)
        jQuery(this.dropdown.nativeElement).dropdown(this.options);
    }
}

Regards.

@vladotesanovic
Copy link
Owner

sm-dropdown is under development, it is not available via npm ( ng-semantic ) yet.

I will publish first version of this module in next few days.

@Eduardo-M-Cavalcanti
Copy link
Author

Hi Vlado,
What you have done already was of great help, thank you :)

@gruentee
Copy link

Hello Vlado, first of all: thanks for your great work!

I'm really looking forward to use the dropdown element and would greatly appreciate if someone could fix it soon. I'd love to contribute something myself, but I'm still quite new to AngularJS… maybe some time soon.

Best regards,
Constantin

@vladotesanovic
Copy link
Owner

@Eduardo-M-Cavalcanti @gruentee sm-dropdown and sm-select are published.

Although, they are not finished, lot of improvements coming.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants