I'm experimenting with the Angular 2 beta and want to use the Semantic UI Dropdown control as Angular 2 component.
http://semantic-ui.com/modules/dropdown.html#converting-form-elements
My small sample project is here:
https://github.com/uNki23/angular2semantic/
I've wrapped it inside an Angular 2 component 'UiSelectComponent' as you can see here:
https://github.com/uNki23/angular2semantic/blob/master/src/app/components/ui-select.component.ts
Any other component should use the UiSelectComponent by passing it two objects: an array holding the possible choices and an optional pre-defined selected choice. I've made an interface for the choice 'SelectOption' which has two properties 'value' (number) and 'displayValue' (string). The component should be used like this:
https://github.com/uNki23/angular2semantic/blob/master/src/app/components/app.component.html
First question: What I want to achieve is, that the pre-selected option is passed to the UiSelectComponent, a user selection changes that option and that option should also change the selected object from the parent component. It's clear that the parent component needs to know, what the selected option from UiSelectComponent is, right?
The second question: Setting the initial selected option inside the semantic ui dropdown just works if I wrap the .dropdown() function inside a setTimeout() function. I thought, that Angular 2 doesn't need that stuff anymore to make changes visible?
I've tried every possible way I've found for the last two days - now I need your help :)
thanks in advance!!