indrimuska / angular-selector

A native AngularJS directive that transform a simple <select> box into a full html select with typeahead.
http://indrimuska.github.io/angular-selector
MIT License
96 stars 36 forks source link

Not working with ng-if #43

Closed RushabhJoshi closed 8 years ago

RushabhJoshi commented 8 years ago

When I use select input with ng-if attribute it won't show any options

<select ng-if="condition" selector multi="true" model="model" options="options" label-attr="label" value-attr="id"></select>

indrimuska commented 8 years ago

Hi @RushabhJoshi, you can't use ng-if directive with other directives that use a private scope. You need to wrap your select inside another block like this:

<div ng-if="condition">
    <select selector ...></select>
</div>
RushabhJoshi commented 8 years ago

Still no luck, Also tried in span tag

indrimuska commented 8 years ago

Check out this plunker: http://plnkr.co/edit/BppzOSMEU8edgaasr3Pt?p=preview

RushabhJoshi commented 8 years ago

I appreciate and this is strange atleast your example shows options (I will see whats missing in my code), but in your example change does not reflect on browser model.

anyways solved a problem with ng-show problem with prefill data in input,

Thanks