luisfarzati/ng-bs-daterangepicker

problem with initializing when using "." model binding

djorgji opened this issue · 2 comments

Found an issue with
if (!$scope[modelValue] || (!$scope[modelValue].startDate)) {
The above will fail if a none direct scope member is used, for example
ng-model="filters.dateRange"
since the above line is going to try to do
$scope["filters.dateRange"]

Why not simply use?
if (!ngModel.$modelValue || (!ngModel.$modelValue.startDate)) {

found these two aswell
$element.data('daterangepicker').startDate = momentify($scope[modelValue].startDate); $element.data('daterangepicker').endDate = momentify($scope[modelValue].endDate);
to
$element.data('daterangepicker').startDate = momentify(ngModel$modelValue.startDate); $element.data('daterangepicker').endDate = momentify(ngModel.$modelValue.endDate);

That's right, i did the same... actually i did a pull request for this issue.

This should be fixed in v0.0.6