When I log the id it shows me the correct id. I want to pass this id in the second url and fetch data accordingly.
Like when the id is 9 and when i put it like this url: &room_type=9&day=1 it works but not when I use it this way url: '&room_type=' +$scope.id + '&day=1'
$http({
method:'GET',
url: '&hotel_id=' +$scope.current_Hotel.hotel_id
}).then(function(response){
var roomdata = response.data;
$scope.roomdata = roomdata;
var roomtype = roomdata.data;
angular.forEach(roomtype, function(value, key){
var id = value.room_type_id;
$scope.id = id;
console.info(id);
});
});
$http({
method:'GET',
url: '&room_type=' +$scope.id + '&day=1'
}).then(function(response){
var plan = response.data;
$scope.plan = plan;
});