angularjs - ui.bootstrap.datepicker is-open not working second time -
i using ui.bootstrap.datepicker , first click working , second click onwards not working.
i used many options is-open='$parent.isopen'
, ng-model="$parent.date ="
, $timeout service
nothing work me.
<div class="input-group"> <input type="text" class="form-control" datetime-picker="mm/dd/yyyy hh:mm" ng-model="mydate" is-open="$parent.isopen" /> <span class="input-group-btn"> <button type="button" class="btn btn-default" ng-click="opencalendar($event, prop)"><i class="fa fa-calendar"></i></button> </span> </div>
this solution works, problem $scope.
html
<input ng-click="opendatepicker($event)" type="text" class="form-control" datepicker-popup="mm-dd-yyyy" ng-model="submission.require_date" is-open="mydp.opened" min-date="mindate" datepicker-options="dateoptions" ng-required="true" close-text="close">
js snippet
$scope.opendatepicker = function($event) { $event.preventdefault(); $event.stoppropagation(); if (typeof($scope.mydp) === 'undefined'){ $scope.mydp = {}; } $scope.mydp.opened = true; };
Comments
Post a Comment