How to get the value of a field with ng-change

后端 未结 3 2080
遇见更好的自我
遇见更好的自我 2021-01-04 09:49

I know how to react to user input in a textarea with ng-change in AngularJS. But how can I get the current input inside the Angular controller? I am missing something like <

3条回答
  •  自闭症患者
    2021-01-04 10:12

     angular.module('myApp', [])
        .controller('myCtrl', ['$scope', function($scope) {
          $scope.myFunc = function(vals) {
            console.log(vals);
    		$("#result").html(vals);
          };
        }]);
    body{
      background:#ffc10721;
    }
    
    
    
    
    
    

    Write something in the Textarea


    Result :

提交回复
热议问题