I have the following code and I am trying to use the return value of a function to initialize a property of an object.
$scope.data = {
trackingItemStatus: {
options: SPListUtility.GetChoiceOptionsJson(),
defaultOption: {value: 'Active', text: 'Active'}
}
}
Right before returning from my service above I log the variable to be returned and it is coming back as follows so I know it should be working:
[{"text":"Active","value":"Active"},{"text":"Closed","value":"Active"},{"text":"On-Hold","value":"On-Hold"},{"text":"Resolved","value":"Resolved"}]
I feel like this should be simple. I just want to assign the return value of my function to data.item.options but it won't work just keeps coming back empty. Am I missing something obvious here?
someFuncThatReturnsArray()returns a Promise, and you are testing it for the resolved value?