When attempting to add the string "New" to a list box, it is being inserted as "undefined".
$http({
method: 'GET',
url: 'http://xxx/api/Maintenance/GetAllFilteredItems',
params: { Pt_Id: PtId}
}).then(function successCallback(response) {
$scope.items = response.data;
}, function errorCallback(response) {
// alert(response);
});
$scope.AddNew = function () {
var Item = [];
Item[0] = 'New'; alert(Item.length);
// $scope.items.splice(0, 0, Item[0].toString());
$scope.items.splice(0, 0, Item[0]);
// $scope.items.push($scope.input);
// $scope.items.splice(0, 0, { itm: 'New'});
$scope.itm = $scope.items[0];
//var item = new String('New')
//$scope.items.splice(0, 0, item);
//$scope.items.unshift(item);
}
Have tried multiple approaches without success.