I am trying to populate the ArrayINeed
array, which is the object I need to pass back to the API call. Currently, I am getting undefined for
"ConfirmedTrackingReferenceNumbers": Dc.ArrayINeed
. Despite researching various posts online and on SO, I have been unable to resolve this issue.
Controller
.
.
.
var Dc = this;
.
.
.
Dc.FlowerData = function () {
Dc.ArrayINeed = [];
if (Dc.Data.validate()) {
if (isTulipFlower) {
requestData = {
"FlowerId": Dc.FlowerId,
"ConfirmedTrackingReferenceNumbers": Dc.ArrayINeed
};
.
.
.
HTML
<div ng-repeat="(item, data) in Dc.DataToLoopThrough">
<div ng-if="item === 'flowers'">
<div ng-repeat="flowerItem in data">
<table ng-if="flowerItem.flowerType === 'Tulip'">
<tr ng-repeat="refNumber in flowerItem.flowerReferenceNumbers">
<td ng-if="refNumber.isRequiredForTracking && refNumber.value != null">
<input ng-value="refNumber.value != null ? refNumber.value : ''" type="text" />
</td>
<td ng-if="refNumber.isRequiredForTracking && refNumber.value == null">
<input ng-model="Dc.ArrayINeed[$index].refNumber" type="text" />
</td>
</tr>
</table>