Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

when change from parameters view doesn't change #145

Closed
elia-c opened this issue Jan 13, 2016 · 2 comments
Closed

when change from parameters view doesn't change #145

elia-c opened this issue Jan 13, 2016 · 2 comments

Comments

@elia-c
Copy link
Contributor

elia-c commented Jan 13, 2016

I have two ionic-datepicker object: "start" and "end", I want that when someone change "end" date the start date change his from parameter according to end date minus some months. I create a watch to the value but when I change from parameter the view doesn't change according new value.

$scope.$watch('endDate.inputDate', function (value) {
        if (value && $scope.maxMonths){
            var newStartDate = new Date(value);
            newStartDate.setMonth(newStartDate.getMonth() - $scope.maxMonths);
            $scope.startDate.from = newStartDate;
            if ($scope.StartDate.inputDate < newStartDate){
                $scope.startDate.inputDate = null;
            }
        }
    });
@deckerj
Copy link

deckerj commented Feb 23, 2016

the reason for this is that the directive has an isolated scope and most scope variables from the controller are loaded once when the directive is created.

I had a similar issue with the label texts. Eventually, I forked the project and "refresh" the labels just before the popup is shown.

@rajeshwarpatlolla
Copy link
Owner

Please check the new release v1.0.0. This issue has been addressed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants