input field:
<input type="text" data-ng-model="some_model" />
The initial state of some_model is null. When I add some arbitrary value to the input field and remove it again, some_model becomes an empty string.
What I can do to solve this is something like:
if($scope.some_model != null && $scope.some_model != undefined && $scope.some_model.trim() == 0){
$scope.some_model=null;
}
This works, but I'm wondering if there is a standard angular way of doing this?