UI面具和日期选择器的角 [英] Ui mask and datepicker in angular
问题描述
下面是同样的问题:<一href=\"http://stackoverflow.com/questions/24786796/angular-ui-bootstrap-date-picker-combined-with-ui-mask\">Angular UI引导日期选择器吐纳UI.Mask 结果
我找不到任何soloution。结果
这里是我的普拉克: http://plnkr.co/edit/i8TBYPonHd1ZxZc9Sac2?p=preVIEW
here is the same question : Angular UI Bootstrap date-picker Combined With UI.Mask
and i can't find any soloution for that .
here is my plunk : http://plnkr.co/edit/i8TBYPonHd1ZxZc9Sac2?p=preview
<div class="col-md-6">
<p class="input-group">
<input type="text" class="form-control" ui-mask="9999/99/99" 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-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>
</p>
</div>
问题是这两个指令没有很好地工作在一起。结果
任何想法?结果
非常感谢
the problem is these two directive don't work perfectly together .
Any idea ?
Many thanks
推荐答案
这为我工作:
angular.module('app', [])
.config(function ($provide) {
$provide.decorator('datepickerPopupDirective', function ($delegate) {
var directive = $delegate[0];
var link = directive.link;
directive.compile = function () {
return function (scope, element, attrs) {
link.apply(this, arguments);
element.mask("99/99/9999");
};
};
return $delegate;
});
});
我在这里找到这个答案:
<一href=\"http://stackoverflow.com/questions/24786796/angular-ui-bootstrap-date-picker-combined-with-ui-mask\">Angular UI引导日期选择器吐纳UI.Mask
这篇关于UI面具和日期选择器的角的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!