Obtendo arquivos JSONP da hospedagem Firebase através do Angular
Estou tentando obter um.json
arquivo do servidor remoto do 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.
}
);
}
Mas se eu abrirurl
no navegador, o arquivo json é carregado. Mesmo se euwget url
o arquivo json é carregado. Mas através angular retorna um404
não encontrado.
Agora o.json
O arquivo remoto possui esta estrutura:
[
{
"hello":"Europe"
},
{
"hello":"USA"
}
]
O arquivo acima pode ser obtido usando $ http.get (), mas não com $ http.jsonp (). O JSONP não pode analisar o arquivo .json com a estrutura acima. Como posso resolver isso?