zomato-api

Not able to use props to query API in react js

China☆狼群 提交于 2019-12-24 19:24:04
问题 I have Restaurants component which is responsible for listing restaurants from Zomato Dev APIs. I have passed Category and City from other components to Restaurants component. I am opening Restaurants component with below code : this.props.history.push( { pathname : '/restaurants', valueCategory : this.props.location.valueA, // CATEGORY valueCity : this.state.cities[index] // CITY }); I want to use these valueCategory and valueCity in calling /search api. Code : class Restaurants extends

Zomato api with angular

Deadly 提交于 2019-12-13 05:19:15
问题 I'm fairly new to coding and am having issues loading data from the Zomato API with angulars $http. I keep getting invalid API key popping up as an error in my console even though im using the API key generated by Zomato. Here is a snippet of my code: http://jsfiddle.net/3j1c816v/1/ $http({ method: 'GET', url: 'https://developers.zomato.com/api/v2.1/search?', params: { user_id: '', // API key entity_type: 'city', q: 'food', } Please let me know if i'm doing anything wrong or any helpful