How to assign selected option's text to another model while using ng-options?

前端 未结 3 586
情深已故
情深已故 2021-01-22 21:31

I can create a select tag and place data inside it. I can assign that select\'s selected option to a model but can\'t assign its text to another model.

Here is example b

3条回答
  •  [愿得一人]
    2021-01-22 21:59

    Please see demo below In select change your model to cutomer and in inputs use customer.id customer.name

    function DemoCtrl($scope) {
      $scope.content = [{
        name: "Bireysel",
        id: 1
      }, {
        name: "Kurumsal",
        id: 2
      }, {
        name: "Bireysel & Kurumsal",
        id: 3
      }];
    
    }
    
    

提交回复
热议问题