Find out how to access third-party APIs in your Angular 2 application without an access token using REST requests and JSONP.
- [Teacher] JSONP is a rest service we can use…to bypass cross-origin domain restrictions,…and is often used when an application needs data…from a publicly available third-party API…and there's no established access token.…JSONP stands for JSON with Padding, and just like…a GET request, it returns a response object.…The difference is that JSONP returns the object…inside a function with a known variable name.…The function is defined and invoked locally…by the application with the response object…from the server passed in as an argument.…
For the browser, it appears as if the function definition…and its execution occurred in the same domain.…Angular makes it very easy to work with JSONP,…and the API is identical to that of the…Http class we used earlier in this course.…To use JSONP, we import the JsonpModule class…from angular/http into our app.module file and add it…to the array of imports in our NgModule decorator.…
This gives our entire application…access to the various JSONP methods.…We then import the Jsonp class from the angular/http…
- Overview of data storage options
- Saving and retrieving data from the browser
- Setting routes in the URL
- Using query strings and fragments instead of routes
- Saving and retrieving data from a server
- Working with user input
- Using JSONP instead of HTTP
- Why writing custom services is important
- Writing custom services for working with browsers and servers
Skill Level Intermediate
1. Getting Started
Application overview1m 39s
2. Data Storage Options
3. Storing Data in the Browser
4. Storing Data on a Server
5. Writing Custom Services
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.