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

docs($http): update YQL currency exchange API example #16137

Closed

Conversation

andypotts
Copy link
Contributor

@andypotts andypotts commented Jul 30, 2017

Closes #16130

What kind of change does this PR introduce? (Bug fix, feature, docs update, ...)
docs update

What is the current behavior? (You can also link to an open issue here)
Currently, the example uses YQL to fetch currency exchange rates (#16130)

What is the new behavior (if this is a feature change)?
I have updated the example to a simpler solution that uses the Fixer.io API.

Does this PR introduce a breaking change?
No

Please check if the PR fulfills these requirements

Other information:

Copy link
Member

@gkalpak gkalpak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A couple of nits. LGTM otherwise.
💯 for simplifying the example.

@@ -186,7 +186,7 @@ Right now, the `InvoiceController` contains all logic of our example. When the a
is a good practice to move view-independent logic from the controller into a
<a name="service">{@link services service}</a>, so it can be reused by other parts
of the application as well. Later on, we could also change that service to load the exchange rates
from the web, e.g. by calling the Yahoo Finance API, without changing the controller.
from the web, e.g. by calling the Fixer.io exchange rate API, without changing the controller.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Make Fixer.io a link.

@@ -300,7 +300,7 @@ to something shorter like `a`.

## Accessing the backend

Let's finish our example by fetching the exchange rates from the Yahoo Finance API.
Let's finish our example by fetching the exchange rates from the Fixer.io exchange rate API.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Make Fixer.io a link.

@@ -100,7 +100,7 @@ Protection from JSON Hijacking is provided if the server prefixes all JSON reque
AngularJS will automatically strip the prefix before processing it as JSON.
For more information please visit {@link $http#json-vulnerability-protection JSON Hijacking Protection}.

Bear in mind that calling `$http.jsonp`, like in [our Yahoo! finance example](https://docs.angularjs.org/guide/concepts#accessing-the-backend),
Bear in mind that calling `$http.jsonp`, like in [our currency exchange example](https://docs.angularjs.org/guide/concepts#accessing-the-backend),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, this line in... clause is obsolete. We no longer use jsonp in that example for quite some time.
Please remove that part.

@gkalpak gkalpak added this to the Backlog milestone Jul 31, 2017
@gkalpak
Copy link
Member

gkalpak commented Jul 31, 2017

You know what would be awesome (not necessarily in this PR)?
Adding some end-to-end tests for that example 😁

@andypotts
Copy link
Contributor Author

@gkalpak I've fixed those issues, and agree that some end-to-end tests would be good. When I get a chance I'll create another PR 😄

@@ -186,7 +186,7 @@ Right now, the `InvoiceController` contains all logic of our example. When the a
is a good practice to move view-independent logic from the controller into a
<a name="service">{@link services service}</a>, so it can be reused by other parts
of the application as well. Later on, we could also change that service to load the exchange rates
from the web, e.g. by calling the Yahoo Finance API, without changing the controller.
from the web, e.g. by calling the <a href="http://fixer.io" title="fixer" target="_blank">Fixer.io</a> exchange rate API, without changing the controller.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

.ngdoc files understand markdown. You can use [Fixer.io](http://fixer.io) for brevity.

@@ -100,7 +100,7 @@ Protection from JSON Hijacking is provided if the server prefixes all JSON reque
AngularJS will automatically strip the prefix before processing it as JSON.
For more information please visit {@link $http#json-vulnerability-protection JSON Hijacking Protection}.

Bear in mind that calling `$http.jsonp`, like in [our Yahoo! finance example](https://docs.angularjs.org/guide/concepts#accessing-the-backend),
Bear in mind that calling `$http.jsonp`,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove the ,. It is not necessary any more.

@andypotts
Copy link
Contributor Author

@gkalpak thanks, hopefully it's good to go now!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

outdated example with Yahoo Finance API
3 participants