function getCashAdvanceSelectors(selected) {
datacontext.getCashAdvanceChoices()
.then(function (data) {
var arr = [];
data.forEach(function (entry) {
var ok = false;
if (selected != null && selected.indexOf(',') > -1) {
selected.split(',').forEach(function (item) {
if (entry == item) {
ok = true;
}
});
} else if (selected != null) {
if (entry == selected) {
ok = true;
}
}
var obj = {
name: entry,
selected: ok
};
arr.push(obj)
});
vm.CAItems = arr;
});
}
No comments:
Post a Comment