Obtención de archivos JSONP del alojamiento de Firebase a través de Angular
Estoy tratando de obtener un.json
archivo del servidor remoto firebase.
function fetchData(remoteJsonId){
var url = "https://myAppName.firebaseapp.com/topics/"+remoteJsonID;
console.log(url); //This variable expands to the full domain name which is valid and returns success both on wget and the browser
$http.jsonp(url).then(
function(resp){
},
function(err){
console.log(err.status) // This posts "404" on console.
}
);
}
Pero si abrourl
en el navegador se carga el archivo json. Incluso si yowget url
se carga el archivo json. Pero a través de angular devuelve un404
extraviado.
Ahora el.json
El archivo remoto tiene esta estructura:
[
{
"hello":"Europe"
},
{
"hello":"USA"
}
]
El archivo anterior se puede recuperar usando $ http.get () pero no con $ http.jsonp (). JSONP no puede analizar el archivo .json con la estructura anterior. ¿Cómo puedo solucionar esto?