The data traversed by angular is submitted to controller after modification of how to bind to modal (pop-up box).

problem description

typeList is the data coming from the background, and every result I traverse is type. I want to extract id and ran_name to modal pop-up box display, and then submit to controller. However, the id, will not be temporarily saved and the id and raw_name will not be displayed in the modified pop-up box. (really a vegetable chicken intern)

the environmental background of the problems and what methods you have tried

< td ng-init = "status = type.id" > {{type.id}} < / td >
an attempt was made to add an extra line of td, using ng-init, but the interface failed to get the sample. Or whether ng-model binds to [modify] button, or fails.

related codes

/ / Please paste the code text below (do not replace the code with pictures)

< tr ng-repeat= "type in typeList track by $index" ng-class= "{"odd": $index%2=1," even": $index%2=0}" >

                        <td ng-init ="status =type.id">{{type.id}}</td>
                        <td style="padding-top: 14px;">{{type.raw_name}}</td>
                        <td style="padding-top: 14px;">{{type.alias}}</td>
                        <td style="padding-top: 14px;">{{type.showname}}</td>                          
                        <td >      
                            <!--<button type="button" class="btn ui-btn ui-btn-primary" data-toggle="modal" data-target=".updatetype"></button></div>-->
                            <button class="btn ui-btn ui-btn-primary" ng-model="typelib.status" data-toggle="modal" data-target=".myModal"></button>

                        </td>
                     </tr>
                     

/ / the following is the code for modal.
< div class= "modal myModal" tabindex= "- 1" role= "dialog" aria-labelledby= "myModalLabel" >

<div class="modal-dialog">
    <div class="modal-content">

< div class= "modal-body" >

            <p class="alertInfo">:
            <input type="text" id="name" name="alias" ng-model="input1"/>

<p class="alertInfo">: <input type="text" id="name" name="showname" ng-model="input2"/>

/ / try to get the background code of id

   //id
   $scope.getSelectedId = function(){
  
        angular.forEach($scope.typeList, function(data, index, array){
            if(data.status){
                $scope.id = data.id;
            }
        });
    };
    

what result do you expect? What is the error message actually seen?

is very disappointed, there is no suitable senior guidance, a little tired. No suitable information was found on the Internet. Silently wish me a happy birthday today.

Sep.16,2021

Save the data you want to display to the global

Menu