角度1.6では、ユーザーが入力内の値を削除すると、これらの値は「未定義」に設定されます。これはAngularJSのデフォルト動作のようです。ユーザーがAngularJS 1.6の値を削除したときに、自動的に入力値を空白( "未定義"ではなく)として設定する方法はありますか?
HTML
<input ng-model="name" class="form-control" id="inp_name"
placeholder="My Name" required="true" value="" />
コントローラに自動的にテキスト入力はフロントエンドに空である代わりに「未定義」の各時間の空のように値を設定する方法を
...
$scope.name = ""; <-- here the initial value is correctly set up as empty
...
$scope.submit = function(){
alert($scope.name); <-- the value can be "undefined" if the user removed all the string
};
?