I like to use the ui.bootstrap.datepicker
directive with a specific format returned to ng-model. This has already been answered in this thread (DatePicker Have the Model come back as a specific format.). However, I don't understand what return +viewValue;
does in the given solution. Can someone please tell me what this line of code mean? Thanks.
Plunker here
app.directive('myformat', function() {
return {
require: 'ngModel',
link: function(scope, element, attrs, ngModel) {
ngModel.$parsers.push(function(viewValue) {
return +viewValue; //????????? what is this doing?
});
}
}
});