8000 Unexpected use of leading/trailing underscore in parameter name in tutorial · Issue #1163 · angular/angular.js · GitHub
[go: up one dir, main page]

Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.
This repository was archived by the owner on Apr 12, 2024. It is now read-only.
Unexpected use of leading/trailing underscore in parameter name in tutorial #1163
Closed
@brettcannon

Description

@brettcannon

In step 5 in the Test section (http://docs.angularjs.org/tutorial/step_05), the example for testing the controller has the line beforeEach(inject(function(_$httpBackend_, $rootScope, $controller). Now the _$httpBackend_ looks weird after the whole previous discussion on DI and that Angular uses stuff with a leading $ and doesn't mention underscores.

I assume this is to prevent name clashing with the higher scoped $httpBackend in the code. If that's true, then a mention of this would be helpful instead of requiring one to guess that this is the reason. Else couldn't you just swap the variable names between the higher defined $httpBackend and the $httpBackend parameter to avoid this whole discussion in the tutorial?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0