0

I have a datepicker on angular.js:

<input type="text" class="form-control" datepicker-popup="{{format}}" ng-model="dt" is-open="opened" min-date="minDate" max-date="'2015-06-22'" datepicker-options="dateOptions" date-disabled="disabled(date, mode)" ng-required="true" close-text="Close"> 

When I click the first time on button , work well, but when I click again , it did work .

I try this:

$scope.open = function ($event) { $event.preventDefault(); $event.stopPropagation(); $scope.opened = true; }; 

and this:

$scope.open = function ($event) { $event.stopPropagation(); $scope.opened = true; }; 
1
  • what is expected second click flow? Commented Mar 24, 2015 at 19:28

1 Answer 1

1

Because your button doing same i.e. setting variable to true so you don't get any effect on screen. try this:

$scope.open = function ($event) { //change this $scope.opened = !$scope.opened; $event.preventDefault(); $event.stopPropagation(); }; 
Sign up to request clarification or add additional context in comments.

1 Comment

No, don`t worked. I do like this on html: ng-click(opened=true;$event.stopPropagation()); and worked. anyway thank you.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.