0

I have created a custom directive using angular UI datepicker. Angular UI datepicker popup should get opened on button click event. This button click event is getting fired and is-open boolean value is being set to true, But the popup is not showing. Please advise.

Plunker Link: http://plnkr.co/edit/wszoqlmIzS6h3majJrnN?p=preview

4
  • the datepicker popup shows in your plunker, using Chrome Commented Feb 16, 2015 at 15:15
  • but not when pressing the button Commented Feb 16, 2015 at 15:17
  • right, got it, the button on the right does not open the popup Commented Feb 16, 2015 at 15:18
  • Duplicates- stackoverflow.com/questions/24501725/… Commented Feb 16, 2015 at 15:44

1 Answer 1

1

I think problem is the event-propagation of the button, which could be prevented by $event.stopPropagation();. I already had a similiar issue which could solve your problem.

I have updated the plunkr which is now working

In the example in the official documentation you can also find the following lines of code:

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

    $scope.opened = true;
};
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.