Pasvaz / bindonce

Zero watches binding for AngularJs
2.73k stars 278 forks source link

Select ng-options #67

Open adamalbrecht opened 10 years ago

adamalbrecht commented 10 years ago

My most common use case for bindonce is a mostly-static list of options to go inside a select element, but I can't figure out how to do it properly.

I tried doing the following, but it stopped binding to my specified ngModel.

<select ng-model='state'>
  <option bindonce ng-repeat='state in states' bo-value='state.abbr' bo-text='state.name'></option>
</select>

Even if I do get this to work, it would be great if I there were a bo-options for use on select elements.

lorenzhs commented 10 years ago

I'm not very good at all this bindonce stuff, but I do think it's quite unnecessary to give each option a bindonce scope of its own. It would probably be better to move the bindonce to the <select> tag (<select bindonce ng-model='state'>).

Probably won't do anything about your issue, though, just a general comment. Sorry ;)

paivaric commented 9 years ago

+1 to bo-options

FDiskas commented 9 years ago

+1 me to