Angular - Input1 Value Input2 same value when Checkbox is checked

后端 未结 3 610
忘掉有多难
忘掉有多难 2021-01-25 11:26

i have a problem, Here my code

3条回答
  •  借酒劲吻你
    2021-01-25 12:22

    Try this one;

        var pesan = angular.module("pesan", []);
    
            pesan.controller("datapesan", function($scope){
    
              $scope.$watch('check',function(){
    
                if($scope.check === 'Yes'){
                   $scope.nama1=$scope.nama;
                    $scope.telephone1=$scope.telephone;
                } else {
                    $scope.nama1='';
                    $scope.telephone1='';
                }
              });
    
    
        });
    

提交回复
热议问题