2

I have a form wizard which is has some dropdowns the user needs to select before submiting.

The user should select from the dropdown and the id should send to the server.

HTML

            <select id="plateId" ng-model="selectedPlate" ng-options="plate as (plate.wafer_id + ' - ' + plate.serial_number) for plate in plates" ng-change="getSelectedPlateID()"/>
                <option value="">Select</option>


            </select>

And my controller looks something like this.

Controller

  $scope.plateid = [];


        $scope.subjects = {

            equipment_status_codes_id: 1,
            plate_container_id: 3,
            plate_container_slot: 35,
            plate_quality_id: 1

        }


    PlatesFactory.query(function(plates)
    {
        $scope.plates = plates;

    });

    $scope.getSelectedPlateID = function()
    {
     $scope.plataid.push($scope.selectedPlate.id);

      //console.log($scope.plataid);
      //
      //console.log($scope.selectedPlate.id)
    }
    PlatesInspectionFactory.update({id : $scope.plataid},$scope.subjects)

When the user clicks on submit button storePlatesInspection will be triggered. But How can I save all the id's and than take those and store them back in the DB .

UPDATE #1:I am very close now. I just want to grab the selected id from the drop down and store it or in plateid array or passe it through the update method below. Someone any idea?

georgeawg
  • 48,608
  • 13
  • 72
  • 95
user3641381
  • 1,036
  • 3
  • 15
  • 29

0 Answers0