After reading and using Sander Elias' answer, I was using this, but ran into another problem.
When combining his result with ng-required="true" in the <input> you could not empty the field, because when the field would be empty, the newVal is passed as undefined.
After some more research, I found an isssue on GitHub that addresses and solves this problem.
Here is what Sander's and the GitHub answer combined look like:
$scope.propertify = function (string) {
var property = $parse(string);
var propAssign = property.assign;
return function (newVal) {
if (arguments.length) {
newVal = angular.isDefined(newVal)? newVal : '';
propAssign($scope, newVal);
}
return property($scope);
};
};
The argument.length reflects the number of values that are passed to the getter/setter and will be 0 on a get and 1 on a set.
Besided that, I added the angular.isDefined() as Sumit suggested in a comment to also save false and empty ("") values.
Here is an updated Plunker