简体   繁体   English

如何在Angular UI Modal中使用Datepicker

[英]how to use Datepicker in Angular UI Modal

i have string datepicker its working fine when i use in page but its not working when i use this datepicker in Angular UI modal '$uibModal' ... how to use this i spend 4 hours in this issue but not its not working https://cdnjs.com/libraries/bootstrap-datetimepicker 我有字符串datepicker,当我在页面中使用时可以正常工作,但是当我在Angular UI模式'$uibModal'中使用此'$uibModal'时,它无法正常工作...如何使用它,我在此问题上花费了4个小时,但无法正常工作https: //cdnjs.com/libraries/bootstrap-datetimepicker

  <div class="col-md-4">
            <div class="input-group date form_date " data-date="" data-date-format="dd-mm-yyyy" data-link-field="dtp_input2" data-link-format="yyyy-mm-dd">
                <input ng-model="FromDate" autocomplete="off" id="FromDate" class="form-control input-height" placeholder="Date" type="text">
                <span class="input-group-addon"><span class="fa fa-calendar"></span></span>
            </div>
        </div>



 var modalInstance = $uibModal.open({
            animation: this.animationsEnabled,
            templateUrl: '../../../Templates/AddModel.html',
            controller: 'RCtrl',
            scope: $scope,
            size: 'lg'
        });
        $scope.modalInstance = this.modalInstance;
        return modalInstance.result;

Here is your modified code: 这是修改后的代码:

var modalInstance = $uibModal.open({
      animation: this.animationsEnabled,
      templateUrl: '../../../Templates/AddModel.html',
      controller: 'RCtrl',
      scope: $scope,
      size: 'lg'
});

modalInstance.opened.then(function(){
   $timeout(function(){
     $('#FromDate').datetimepicker();
   }, 500) 
});

$scope.modalInstance = modalInstance;

return modalInstance.result;    

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Angular UI模式中的日期选择器未打开 - Datepicker in Angular ui modal not opening 如何在 Angular UI Bootstrap Datepicker 中使用模板? - How to use a template in Angular UI Bootstrap Datepicker? 如何在角度1.5中使用ui.bootstrap.modal的角度分量? - How to use angular component with ui.bootstrap.modal in angular 1.5? 如何在JQuery UI datepicker Angular指令中使用UTC设置日期? - How to use UTC in JQuery UI datepicker Angular directive for setting the date? 如何在ng-repeat中使用Angular UI Bootstrap DatePicker Popup - How to use Angular UI Bootstrap DatePicker Popup with ng-repeat Angular UI Bootstrap Datepicker:如何将日期作为字符串和特定格式使用 - Angular UI Bootstrap Datepicker: How to use date as a string and in a specific format 如何使用Angular 1.5 *组件*和UI Bootstrap Modal解析 - How to use resolve with Angular 1.5 *components* and UI Bootstrap Modal 模态中的Angular UI Bootstrap datepicker仅在第一次单击时工作 - Angular UI Bootstrap datepicker in modal only working on first click 如何使用angular-ui模态templateURL与节点/快速路由 - how to use angular-ui modal templateURL with node/express routing Angular-ui模态:如何使用同一控制器? - Angular-ui modal: How to use the same controller?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM