1

I am using http://angular-ui.github.io/bootstrap/ (version .10). I need to open a simple modal window on event click of full-calendar (http://arshaw.com/fullcalendar/).

I do that using

 select: function (start, end, allDay) {
                    console.log('Calendar select event fired');
                    var modalInstance = $modal.open({
                        templateUrl: 'template.html',
                        controller: function ($scope, $modalInstance) {
                            $scope.cancel = function () {
                                $modalInstance.dismiss('cancel');
                            };
                        },

                    });

This works first time and the modal opens and closes ok. However on 2nd click onwards the modal doesn't opens. The $modal.open is getting triggered and console shows no error.

The same exercise if it is done using ng-click works all time . This also need after writing a open function in controller.

<button class="btn btn-default" ng-click="open()">Open me!</button>

However my objective is to call the modal open from another directive using $modal.open.

What am I missing ?

appreciate your help.

Plunker Illustration here

3
  • 1
    I don't think it is possible to answer this question without more details (ideally a minimal reproduce scenario using plunker). Commented Jan 20, 2014 at 11:02
  • plnkr.co/edit/ItEqZp?p=preview Commented Jan 20, 2014 at 15:03
  • 1
    The plunker is broken Commented Jan 20, 2014 at 15:08

1 Answer 1

0

Try creating your controller function apart like

controller : 'sampleCtrl'

and then do:

var sampleCtrl=function(){}

Implement your functionality in this function, this will solve your problem.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.