From e77f717ebf8bb2000b96331f696b03910c1aedb6 Mon Sep 17 00:00:00 2001 From: Martin Staffa Date: Mon, 31 Oct 2016 10:29:28 +0100 Subject: [PATCH] docs(guide/Conceptual Overview): fix external api example In 1.6, urls accessed with jsonp must be whitelisted via sce. However, the yahoo finance api used in the example allows CORS access via Access-Control-Allow-Origin:"*", so we can simply use `$http.get` instead. Closes #15336 --- docs/content/guide/concepts.ngdoc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/content/guide/concepts.ngdoc b/docs/content/guide/concepts.ngdoc index 73993d40f..d3ef18004 100644 --- a/docs/content/guide/concepts.ngdoc +++ b/docs/content/guide/concepts.ngdoc @@ -141,7 +141,7 @@ different currencies and also pay the invoice. Total: {{invoice.total(c) | currency:c}} - +
@@ -242,7 +242,7 @@ Let's refactor our example and move the currency conversion into a service in an Total: {{invoice.total(c) | currency:c}} - +
@@ -337,7 +337,7 @@ The following example shows how this is done with Angular: var refresh = function() { var url = YAHOO_FINANCE_URL_PATTERN. replace('PAIRS', 'USD' + currencies.join('","USD')); - return $http.jsonp(url).then(function(response) { + return $http.get(url).then(function(response) { var newUsdToForeignRates = {}; angular.forEach(response.data.query.results.rate, function(rate) { var currency = rate.id.substring(3,6); @@ -371,7 +371,7 @@ The following example shows how this is done with Angular: Total: {{invoice.total(c) | currency:c}} - +