Why does not my option keep selected even with the selected="selected" attribute?

0

I'm working with angular and I have the following select

<select ng-change="$ctrl.calculateDescount(partnerIndex,item)" ng-model="item.offerDiscountId" class="form-control" ng-if="item.view_offer">
                    <option value="">(Selecione uma Promoção)</option>
                    <option ng-repeat="offer in item.offers.data" ng-if="item.subtotal > offer.purchaseLimit" value="{{offer.id}}" ng-selected="item.idOffer == offer.id">{{item.idOffer}} {{offer.id}}</option>
                  </select>
Verifying in the console the second option is with the selected attribute entered by the angle from the ng-selected condition as it should. But do not keep selected by displaying the "(Select a Promotion)" option.

<option ng-repeat="offer in item.offers.data" ng-selected="item.idOffer == offer.id" ng-if="item.subtotal > offer.purchaseLimit" value="30182" class="ng-binding ng-scope" selected="selected">30182 30182 </option> 

I wonder if anyone has ever had this kind of problem and how did you solve it? since even with the selected attribute it is not respecting.

    
asked by anonymous 20.10.2016 / 13:54

0 answers