Skip to content

Documentation straddles HttpModule and HttpClientModule #19280

Closed

Description

@MickeySegal

I'm submitting a...


[X ] Documentation issue or request

Current behavior

The Tutorial at https://angular.io/tutorial/toh-pt6 uses HttpModule, while the Fundamentals information at https://angular.io/guide/http uses HttpClientModule.

According at least to https://stackoverflow.com/questions/45129790/difference-between-http-and-httpclient-in-angular-4, "Use the HttpClient class from HttpClientModule if you're using Angular 4.3.x and above" and that HttpModule will be deprecated.

Expected behavior

It would be good to have the Tutorial use the newer functionality, particularly since the older functionality is to be deprecated.

Until that is implemented, there should be a warning on the Tutorial page that HttpModule is soon to be deprecated, and there should be a warning on the Fundamentals page that HttpClientModule only works if you have Angular 4.3.x or above (ideally with a description of how to check the version).

Minimal reproduction of the problem with instructions

https://angular.io/tutorial/toh-pt6 uses HttpModule
https://angular.io/guide/http uses HttpClientModule

What is the motivation / use case for changing the behavior?

There are many differences between HttpModule and HttpClientModule such as in the ways that JSON objects are handled, and it would be good to have examples of using them in a program with the object complexity of the Tutorial. There are so many interactions with other complex functionality such as RxJS that writing one's first code without the Tutorial is not straightforward.

Environment


Angular version: 4.4.1


Browser:
- [X ] Chrome (desktop) version 61.0.3163.91
 
For Tooling issues:
- Node version: XX  
- Platform:  

Others:

Activity

  1. MickeySegal commented on Sep 20, 2017

    @MickeySegal
    Author

    Another problem with this documentation: "results" is used for two different purposes on https://angular.io/guide/http, in both the JSON file and the TypeScript file. The demos would be more clear if a name is not reused for different items. One can figure out what when one already understands the material or by tinkering, but it is unwelcoming for explanatory material to use gratuitous ambiguity.

  2. MickeySegal commented on Sep 20, 2017

    @MickeySegal
    Author

    Another problem with the documentation is that some environments throw an error for the comma after the last array element in the JSON data on https://angular.io/guide/http
    { "results": [ "Item 1", "Item 2", ] }
    It would be safer to just leave out that comma.

  3. MickeySegal commented on Sep 26, 2017

    @MickeySegal
    Author

    A version at https://plnkr.co/edit/y0rhIR3NjYToVFCXpubZ?p=preview gets much of the functionality working with HttpClientModule, but two methods in hero.service.ts are not working properly: create and update.

  4. added this to the needsTriage milestone on Feb 26, 2018
  5. agussman commented on Mar 13, 2018

    @agussman
    Contributor

    Here's another page that confusingly uses both: https://angular.io/guide/ngmodules

  6. 4 remaining items

  7. jenniferfell commented on May 4, 2018

    @jenniferfell
    Contributor

    Seem to be resolved:

    • Tutorial has been been updated to use HTTPClientModule.
    • HTTPClient (http.md) does not have references to HTTPModule

    May need updates to be current:

    • entry-components.md
    • bootstrapping.md
    • testing.md ("This guide's sample code also demonstrates testing of the legacy HttpModule in app/model/http-hero.service.spec.ts."
    • upgrade.md (upgrading from AngularJS to Angular)
  8. jenniferfell commented on May 4, 2018

    @jenniferfell
    Contributor

    We'll probably need engineering input on best practice for upgrading from AngularJS.

  9. added a commit that references this issue on May 30, 2018
    b5533e0
  10. angular-automatic-lock-bot commented on Sep 13, 2019

    @angular-automatic-lock-bot

    This issue has been automatically locked due to inactivity.
    Please file a new issue if you are encountering a similar or related problem.

    Read more about our automatic conversation locking policy.

    This action has been performed automatically by a bot.

  11. locked and limited conversation to collaborators on Sep 13, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions