我正在尝试使用离子模态内的角材料md-datepicker,并且在使用日期选择器并且日期改变时没有触发ng-change事件,日期选择器本身不会滚动,并且看起来不可点击。当我尝试使用模式外的日期选择器时,所有工作都正常。这里发生了什么?角材料md-datepicker不工作在离子模式
<script id="add-location-modal.html" type="text/ng-template">
<ion-modal-view>
<ion-content>
<md-content layout-padding>
<form name="myForm" style="">
<md-datepicker ng-model="date" ng-change="updateDate(date)" md-placeholder="Date"></md-datepicker>
</form>
</md-content>
</ion-content>
这里是控制器:
angular.module('myModule')
.controller('TripDetailsCtrl'['$scope','$rootScope','$stateParams','tripServices','tripLocationServices','$ionicModal',
function($scope,$rootScope,$stateParams,tripServices,tripLocationServices,$ionicModal){
$scope.trip = [],$scope.tripData = {}, $scope.addLocationModal, $scope.locationData = {},$scope.date;
$scope.showAddLocationModal = function(){
$scope.addLocationModal.show();
};
$scope.closeAddLocationModal = function(){
$scope.addLocationModal.hide();
};
var initModal = function(){
if(!$scope.addLocationModal){
$ionicModal.fromTemplateUrl('add-location-modal.html', {
scope: $scope,
animation: 'slide-in-up'
}).then(function(modal) {
$scope.addLocationModal = modal;
});
}
};
initModal();
是否与日期选择是比模态下的z-index的问题?与我用CSS解决的ui-bootstrap模式和md-datepicker有相同的问题:'.md-datepicker-calendar-pane z-index:1151!important; }'。 –
这也跨越了我的想法,我绝对尝试修改z-index,但没有任何运气。我这样做时没有使用重要的标签,所以我可以尝试一下,但是,我的怀疑现在认为这与[Ionic的300ms点击延迟]有关(http://blog.ionic.io/hybrid -apps-and-the-the-the-curse-the-300ms-delay /) –