Join Justin Schwartzenberger for an in-depth discussion in this video The Angular 2 HTTP bundle, part of Angular 2 Essential Training.
- [Narrator] Angler has a module bundle named HTTP for working with XHR and JSONP calls from the client. To make use of the HTTP module, you need to add it to a list of imports for you Angler module in the app.module.ts file, we can add a new import statement and bring in the HTTP module from the Angler HTTP scoped package.
Then we can add the HTTP module to the import meta data property array. The HTTP module contains all of the services and object constructs needed to work with XHR and JSONP calls. Let's hop over to the systemjs.config.js file in the project for a minute. For the system JS loader which is what the exercise in this course use, the HTTP bundle is being pulled in as a separate resource.
Now this project code is already set up to include the HTTP scope module, so we don't need to make any changes here. But note that HTTP is included in the array of NG package names here. This handles making sure these packages are included from the local node_modules directory when the code is run. This set up will vary depending on what you decide to use for your module loading and build solution. That is definitely a topic for another course.
So I won't go into more detail on that in here. But I do want to point out one more thing. The HTTP module works with Observable's in RXJS. So the RXJS bundle is being included as well in a package objects literal above. The way Angler works with RXJS, it brings in a stripped down version of Observable, only including what it needs. So if your code needs to leverage other operators in RXJS, you need to import them on an individual basis.
We will see how to do this in a lesson in this chapter when we work with the HTTP service.
Justin Schwartzenberger steps through the framework one feature at a time, focusing on the new component-based architecture of Angular 2. You'll learn what Angular is and what it can do, as Justin builds a full-featured web app from start to finish. After mastering the essentials, you can tackle the other project-based courses in our library and create your own Angular app.
- What is Angular?
- Setting up an Angular template
- Creating a component
- Binding events and properties
- Getting data to components
- Using directives and pipes
- Creating Angular forms
- Validating form data
- Understanding dependency injection
- Providing services
- Making HTTP calls
Skill Level Intermediate
1. Architecture Overview
3. Directives and Pipes
5. Dependency Injection and Services
Router links2m 36s
Next steps1m 20s
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
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.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.