javascript - <option ng-repeat value={{object}}> How can i force angular to push the object into the model? -


i have angular 1.2.x project in need use in order able set title , disable different options. plunker: http://plnkr.co/edit/suxpfoxvsufvmi1itkf1?p=preview

 <select ng-change="onconceptnameselect()"         ng-model="result">         <option value="">select value         </option>         <option ng-repeat="value in values"                  value={{value}}                 title="{{value.title}}"                 ng-disabled="value.isdisabled">{{value.name}}         </option> </select> 

the problem i'm facing when selection, ng-model initialized stringified object instead of being initialized object itself.

how can force angular push object model?

thanks

you can convert string value object if need object

have @ updated plunker

$scope.isobject = function() {      return $scope.resultobject instanceof object;  };      $scope.onconceptnameselect = function () {      $scope.resultobject = $scope.$eval($scope.result);  };


Comments

Popular posts from this blog

Delphi XE2 Indy10 udp client-server interchange using SendBuffer-ReceiveBuffer -

Qt ActiveX WMI QAxBase::dynamicCallHelper: ItemIndex(int): No such property in -

Enable autocomplete or intellisense in Atom editor for PHP -