0

When I click on datapicker (angular moment picker) after load it in inline fancybox, it output empty window. But if I click on datapicker input directly - all works fine.

I use fancybox as directive:

    .directive('fancybox', function ($compile, $http) {
        return {
            scope: true,
            restrict: 'EA',

            link: function(scope, element, attrs) {
                scope.openFancybox = function (href) {
                    scope.curHosterUID = angular.fromJson(attrs.hoster);
                    //console.log(scope.chEvent);
                    //scope.curHosterUID = href.replace('#viewEvent', '');
                    console.log(scope.curHosterUID);

                    var template = angular.element(href);
                    var compiledTemplate = $compile(template);
                    compiledTemplate(scope);
                    $.fancybox.open();
                    $.fancybox.open({ href: href, type: 'inline' });

                };
            }
        };
    })
<div class="input-group" moment-picker="ctrl.timepicker" format="HH:mm:ss">
                                        <span class="input-group-addon">
                                            <i class="fa fa-clock-o"></i>
                                        </span>
                                        <input id="event_start" class="form-control"
                                               placeholder="Select a time"
                                               ng-model="ctrl.timepicker"
                                               ng-model-options="{ updateOn: 'blur' }">
                                    </div>

How I can force datapicker in fancybox?

MikeDiam
  • 111
  • 1
  • 11
  • Why are you opening fancybox twice? the first one of course is empty `$.fancybox.open();` – JFK Jul 03 '16 at 19:04
  • Correct, but it does not solve. I moved content to the html template and load it using iframe-fancybox method. But now I have own isolated scope in fancybox popup, and I can't use parent scope, now I want to fix this trouble – MikeDiam Jul 04 '16 at 07:03

0 Answers0