Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

Commit e77f717

Browse files
authored
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
1 parent 872bdbd commit e77f717

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

docs/content/guide/concepts.ngdoc

+4-4
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ different currencies and also pay the invoice.
141141
<b>Total:</b>
142142
<span ng-repeat="c in invoice.currencies">
143143
{{invoice.total(c) | currency:c}}
144-
</span>
144+
</span><br>
145145
<button class="btn" ng-click="invoice.pay()">Pay</button>
146146
</div>
147147
</div>
@@ -242,7 +242,7 @@ Let's refactor our example and move the currency conversion into a service in an
242242
<b>Total:</b>
243243
<span ng-repeat="c in invoice.currencies">
244244
{{invoice.total(c) | currency:c}}
245-
</span>
245+
</span><br>
246246
<button class="btn" ng-click="invoice.pay()">Pay</button>
247247
</div>
248248
</div>
@@ -337,7 +337,7 @@ The following example shows how this is done with Angular:
337337
var refresh = function() {
338338
var url = YAHOO_FINANCE_URL_PATTERN.
339339
replace('PAIRS', 'USD' + currencies.join('","USD'));
340-
return $http.jsonp(url).then(function(response) {
340+
return $http.get(url).then(function(response) {
341341
var newUsdToForeignRates = {};
342342
angular.forEach(response.data.query.results.rate, function(rate) {
343343
var currency = rate.id.substring(3,6);
@@ -371,7 +371,7 @@ The following example shows how this is done with Angular:
371371
<b>Total:</b>
372372
<span ng-repeat="c in invoice.currencies">
373373
{{invoice.total(c) | currency:c}}
374-
</span>
374+
</span><br>
375375
<button class="btn" ng-click="invoice.pay()">Pay</button>
376376
</div>
377377
</div>

0 commit comments

Comments
 (0)