Skip to content
This repository was archived by the owner on Apr 30, 2018. It is now read-only.

Commit 7f1c65d

Browse files
committed
Merge pull request #14 from t8g/patch-2
Accept falsy default value (0, "", ...)
2 parents 8e76d2f + 4442ba0 commit 7f1c65d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/directives/formly-field.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,12 +66,12 @@ angular.module('formly.render')
6666
},
6767
controller: function fieldController($scope) {
6868
$scope.options = $scope.optionsData();
69-
if ($scope.options.default) {
69+
if (typeof $scope.options.default !== 'undefined') {
7070
$scope.value = $scope.options.default;
7171
}
7272

7373
// set field id to link labels and fields
7474
$scope.id = $scope.formId + $scope.options.type + $scope.index;
7575
}
7676
};
77-
});
77+
});

0 commit comments

Comments
 (0)