github-page/main.min.js
function () {
            return $http({
                method: 'GET',
                url: 'https://api.punkapi.com/v2/beers'
            }).then(function (response) {

                var beerArray = response.data;
                var newBeerArray = [];

                beerArray.forEach( function (arrayItem) {
                    newBeerArray.push({
                        label: arrayItem.name,
                        value: arrayItem.name
                    })
                });

                // return processed items
                return newBeerArray;
            });
        }
function () {
            return $http({
                method: 'GET',
                url: 'https://api.punkapi.com/v2/beers'
            }).then(function (response) {

                var beerArray = response.data;
                var newBeerArray = [];

                beerArray.forEach( function (arrayItem) {
                    newBeerArray.push({
                        label: arrayItem.name,
                        value: arrayItem.name
                    })
                });

                // return processed items
                return newBeerArray;
            });
        }
function ( ) { return $http ( { method : 'GET' , url : 'https://api.punkapi.com/v2/beers' } ) . then ( function ( response ) { var beerArray = response . data ; var newBeerArray = [ ] ; beerArray . forEach ( function ( arrayItem ) { newBeerArray . push ( { label : arrayItem . name , value : arrayItem . name } ) } ) ; // return processed items return newBeerArray ; } ) ; }
Get beer list from service
Get beer list from service