0

I am trying to retrieve a hyperlink list item from inside my angularjs controller.

app.controller('myController', function($scope, $http, $filter) {
    method: 'GET',
    url: "https://.../_api/web/lists/GetbyTitle('hightlights')/items?$top=1000$select=Product",
    header: {"Accept": "application/json;odata=verbose}
    }).success(function(data, status, headers, config) {
        $scope.products = data.d.results;
        console.log($scope.products);
   ...

But what I am getting back on my page is the following:

{"__metadata:"{"type":"SP.FieldUrlValue"},"Description":"https://...","Url":"https://..."}

How do I get the url portion?

jaysonn
  • 105
  • 9

1 Answers1

2

My test script for your reference:

    myAngApp.controller('spCustomerController', function ($scope, $http) {  
            $http({  
                method: 'GET',  
                url: _spPageContextInfo.webAbsoluteUrl + "/_api/web/lists/getbytitle('links')/items?$select=URL",  
                headers: { "Accept": "application/json;odata=verbose" }  
            }).success(function (data, status, headers, config) {  
                $scope.customers = data.d.results;  
                                                    console.log($scope.customers);

 $scope.customers.forEach((item,index,array)=>{
        console.log(item.URL.Url)
    })
            }).error(function (data, status, headers, config) {  

            });  
    });
Amos
  • 2,030
  • 1
  • 5
  • 9