0
這裏是我的代碼後,每個dateHolder div的生成日期選取器..但想在他們的ID添加一個ID日期選擇器UI的角度引導的
<div class="col-xs-12 tn-dateContainers" ng-controller="DatepickerDemoCtrl">
<div class="dateHolder mgl" datepicker-popup="{{format}}" ng-click="openSD($event)" ng-model="dateHolder.startDate" is-open="openedSD" datepicker-options="dateOptions" ng-required="true" close-on-date-selection="false" close-text="Close" >
<span class="dateIcoImg"><img src="img/icon-calendar.png" alt=""></span>
<span class="dateIcoText">Start Date</span>
</div>
<div class="dateHolder" datepicker-popup="{{format}}" ng-click="openED($event)" ng-model="dateHolder.endDate" is-open="openedED" datepicker-options="dateOptions" ng-required="true" close-on-date-selection="false" close-text="Close">
<span class="dateIcoImg"><img src="img/icon-calendar.png" alt=""></span>
<span class="dateIcoText">End Date</span>
</div>
</div>
下面是相同的角度代碼.. 並且還想在生成的日期選擇器上添加樣式,因爲這裏的位置非常正確。
請幫我卡住一個項目。
由於提前
vendorOffer.controller("DatepickerDemoCtrl" , function ($scope) {
$scope.dateHolder = {};
$scope.today = function() {
$scope.dateHolder.startDate = new Date();
$scope.dateHolder.endDate = new Date();
};
$scope.today();
$scope.openSD = function($event) {
$event.preventDefault();
$event.stopPropagation();
$scope.openedSD = true;
};
$scope.openED = function($event) {
$event.preventDefault();
$event.stopPropagation();
$scope.openedED = true;
};
$scope.dateOptions = {
formatYear: 'yy',
startingDay: 1
};
$scope.formats = ['dd-MMMM-yyyy', 'yyyy/MM/dd', 'dd.MM.yyyy', 'shortDate'];
$scope.format = $scope.formats[0];
});
這就是我想要的方式,我不想在默認角度做任何改變..但是謝謝 –