When retrieving data from LocalStorage, my code looks like this:
angular.module('madMeApp').controller('campaignInDetails', function($scope) {
var campaignToShow = JSON.parse(localStorage.getItem("CampaignDetails"));
$scope.selectedDays = campaignToShow.selected_days;
});
The selected_days value is returned as a comma-separated string, for example: Tuesday,Wednesday
Based on the selected_days value,
I want to programmatically check the following checkboxes:
<input type="checkbox" value="Monday" name="selected_days" />
<input type="checkbox" value="Tuesday" name="selected_days" />
<input type="checkbox" value="Wednesday" name="selected_days" />
<input type="checkbox" value="Thursday" name="selected_days" />
<input type="checkbox" value="Friday" name="selected_days" />
<input type="checkbox" value="Saturday" name="selected_days" />
<input type="checkbox" value="Sunday" name="selected_days" />
I need assistance with checking the checkboxes using AngularJs based on their respective values. For instance, in this scenario I would like Tuesday and Wednesday checkboxes to be checked.
Thank you.