2016-06-13 116 views
0

我有问题,有关角度引导datepicker弹出。 当我点击图标打开datepicker弹出它将附加HTML元素,但弹出不来。Angular Bootstrap datepicker弹出问题

我检查了一切,但我卡在这里我没有任何关于它的想法。 任何人都可以帮助我?

我使用的角度引导v Version: 0.12.1 - 2015-02-20

我已经使用这个代码:

<div class="input-group w-md"> 
        <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-click="open($event)" ng-required="true" close-text="Close" /> 
        <span class="input-group-btn"> 
        <button type="button" class="btn btn-default" ng-click="open($event)"><i class="glyphicon glyphicon-calendar"></i></button> 
        </span> 
       </div> 

检查控制台: enter image description here

的Javascript控制器:

$scope.today = function() { 
     $scope.dt = new Date(); 
    }; 
    $scope.today(); 

    $scope.clear = function() { 
     $scope.dt = null; 
    }; 

    // Disable weekend selection 
    $scope.disabled = function(date, mode) { 
     return (mode === 'day' && (date.getDay() === 0 || date.getDay() === 6)); 
    }; 

    $scope.toggleMin = function() { 
     $scope.minDate = $scope.minDate ? null : new Date(); 
    }; 
    $scope.toggleMin(); 

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

    $scope.dateOptions = { 
     formatYear: 'yy', 
     startingDay: 1 
    }; 

    $scope.format = 'dd.MM.yyyy'; 
+0

你有这方面的工作任何JavaScript代码? – Mistalis

回答

0

可以参考我的plunker

我你的代码复制到我的plunker,使用open1()代替open($event)

+0

您好,您正在使用* uib-datepicker-popup *,但其最新的角度bootstrap我使用旧版本 –

+0

可以请你给我一个你的代码plunker? –

+0

好的...我会尝试 –