单击角提交后如何清除输入

时间:2019-04-13 11:19:26

标签: javascript html angularjs

我需要清除用户单击“提交”按钮后写的输入 我不知道我必须在脚本中插入哪些代码以清除它们

<p>
   <input type="text" placeholder="name" ng-model="person.name">
</p>
<p>last name: <input type="text" placeholder="last name" ng-model="person.Lname"></p>
<p>phone number: <input type="text" placeholder="number" ng-model="person.number"></p>
<button type="submit" ng-click="sabt()">submit</button>
<table class="table">
    <tr>
        <th>name</th>
        <th>last name</th>
        <th>phone number</th>

    </tr>
    <tr ng-repeat="x in list">
        <td>{{x.name}}</td>
        <td>{{x.Lname}}</td>
        <td>{{x.number}}</td>

    </tr>

</table>
var app = angular.module("myApp",[]);
app.controller("myCtrl",function($scope){
    $scope.list=[];
    $scope.person={};
    $scope.sabt = function(){
        $scope.list.push($scope.person);        
    }       
});

1 个答案:

答案 0 :(得分:2)

<meta property="og:url" content="https://example.com/xyz">