My Angular code snippet is up and running:
var url ="https://api.flickr.com/services/rest/?method=flickr.photos.search&
api_key=c4e2f731926eefa6fe1d3e9c2c9f9449&tags=coffee&format=json&jsoncallback=JSON_CALLBACK";
$http.jsonp(url).then(function(response) {
console.log(response.data);},function(){console.log('Error retrieving JSON data')}
);
Yet, I'm stuck on how to pass a variable's value to tags
instead of hardcoding it as coffee or chocolate. Is there a more efficient way to structure all the necessary information (api_key, format, tags) in an object and append it to the URL?