1. Add three control to the UI: StartTime EndTime Weekdays:
2015-11-17 20:26:40
data-model: Html5在html里的体现
k-checklist-model: kendoUI
ng-click/ng-value/ng-checked: Angular在html里的体现
1 <div class="pn-module-funcname-new-field"> 2 <div>Start Time</div> 3 <input class="ds-import-conn-new-value" kendo-time-picker k-ng-model="selectedStartTime" k-options="startTimeOptions" /> 4 </div> 5 <div class="pn-module-funcname-new-field"> 6 <div>End Time</div> 7 <input class="ds-import-conn-new-value" kendo-time-picker k-ng-model="selectedEndTime" k-options="endTimeOptions" /> 8 </div> 9 <div class="pn-module-funcname-new-field"> 10 <div>Days Of Week to Run</div> 11 <br /> 12 <div class="pn-module-funcname-new-checkbox"> 13 <div ng-repeat="item in checkBoxWeekdays"> 14 <input type="checkbox" ng-checked="selectedWeekdays.indexOf(item) > -1" ng-value="{{item}}" ng-click="check(item, $event)"> {{item}} 15 </div> 16 </div> 17 </div>
js:
1 $scope.checkBoxWeekdays = ['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday']; 2 3 $scope.check = function (value, e) { 4 var idx = $scope.selectedWeekdays.indexOf(value); 5 if (idx >= 0 && !e.target.checked) { 6 $scope.selectedWeekdays.splice(idx, 1); 7 } 8 if (idx < 0 && e.target.checked) { 9 $scope.selectedWeekdays.push(value); 10 } 11 };
2. ng-change doesn't get the $event argument
https://github.com/angular/angular.js/issues/6370