如何選擇至少一個複選框(週一至週日)如果選擇第一個單選按鈕(在html標記中,不需要調用任何函數)?AngularJS - 如何選擇此代碼中所需的至少一個複選框?
<input type="radio" name="dailyOption"
ng-model="vm.reportSchedule.DailyOption" value="FollowingDays">
<label ng-repeat="(day, bool) in vm.reportSchedule.DailyRunOnDays">
<input type="checkbox" name="dailyRunOnDays"
ng-model="vm.reportSchedule.DailyRunOnDays[day]">{{day}}
</label>
<input type="radio" name="dailyOption"
ng-model="vm.reportSchedule.DailyOption" value="EveryWeekday">
<input type="radio" name="dailyOption"
ng-model="vm.reportSchedule.DailyOption" value="RepeatAfterDays">
模型
vm.reportSchedule
{
"AppId": "ReportScheduleId",
"Today": "2017-04-25T12:53:00Z",
"UserId": 7466897,
"ScheduleId": null,
"Name": null,
"Description": null,
"Type": "Daily",
"StartSchedule": "2017-04-25T12:53:00Z",
"StopSchedule": "2017-04-25T12:53:00Z",
"NextRunTime": null,
"LastRunTime": null,
"Permission": {
"FullAccess": true,
"View": true,
"Create": true,
"Update": true,
"Delete": true
},
"RunEveryHours": 1,
"RunEveryMinutes": 1,
"DailyOption": "RepeatAfterDays",
"MonthlyOption": "CalendarDate",
"DailyRunOnDays": {
"Mon": false,
"Tue": false,
"Wed": false,
"Thu": false,
"Fri": false,
"Sat": false,
"Sun": false
},
"WeeklyRunOnDays": {
"Mon": false,
"Tue": false,
"Wed": false,
"Thu": false,
"Fri": false,
"Sat": false,
"Sun": false
},
"RepeatAfterDays": 1,
"RepeatAfterWeeks": 1,
"RepeatMonths": 1
}
非常感謝,很好 – monstro