Hi binaryMoods,
No, you do receive the response, not the json. The response is everything
around your request (redears,config,uri and data). the stuff you need is
inside data.
I use a construct like this most of the time:
function Yahou_fin($http) {
var url = YAHOO_FINANCE_URL_PATTERN. replace('PAIRS', 'USD'
+ currencies.join('","USD'));
return $http
.jsonp(url)
.then(resp => resp.data) //es6 arrow function supported in all
browsers I care about.
.then(data => {
data.query.results.rate.reduce((newUsdToForeignRates, rate) => {
newUsdToForeignRates[rate.id.substring(3,6)]=window.parseFloat(rate.Rate
);},{})
})
;
}
You plunker seems to miss angular and yahoo script. I have no time now to
fix it.
Oh, and you last question, that's just how JSONP works, and is there for
your protection.
Regards
Sander
--
You received this message because you are subscribed to the Google Groups
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.