angularjs - Angular: Select dropdown with ng-model-options setter getter set to true -
can show me example on how bind ng-options
getter , setter model, plnker
demo great.
example on want accomplish:
// can see item object 2 properties example: // {text: "hello", value: 10} setgetobject: function(value) { if (angular.isdefined(value)) { myobject = angular.copy(value); //copy incoming object } return ???? }
<select class="form-control" name="rumfra" ng-model="gettersetter.setgetobject" ng-options="item item.text item in vm.configuration.form.room track item.value" ng-model-options=" {gettersetter: true }">
each time make new selection on dropdown set myobject
new value dropdown not effected if return input element.
a working example on how use select tag ng-options
, ng-model-options="{settergetter= "true"}"
appreciated :-)
look @ numyx's example:
http://plnkr.co/edit/sqjg8np7e9nb9okcd4hn?p=preview
because working not objects. can objects?
just use ng-model . ng-model binds input,select , textareas. see example
<select ng-options="p.name p in animal" ng-model="selectedanimal"></select>
Comments
Post a Comment