vladotesanovic / ngSemantic

Angular 2 building blocks :package: based on Semantic UI
https://ng-semantic.herokuapp.com/
MIT License
973 stars 148 forks source link

Reset <sm-select> after form submit? #148

Open snstarosciak opened 7 years ago

snstarosciak commented 7 years ago

Hey there, is there a way to reset the <sm-select>back to its initial state of no value selected? I have a form that, once submitted, maintains the state of the select dropdowns, even though I create a brand new form, which should clear the values selected in each dropdown.

sushanzh commented 7 years ago

I am facing the same challenge. Did you find a way to do it please?

gameot commented 7 years ago

I did this by @ViewChild and the semantic-ui clear parameter. Some code:

...
@ViewChild("selectE") selectE: SemanticSelectComponent;

resetSelect(){
    jQuery(this.selectE.select.nativeElement).dropdown('clear');
}

But have small issue, see #182