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.

ngMock: wrong parsing of pathParams when there are queryParams #14173

Closed
@marcoancona

Description

@marcoancona
  • Do you want to request a feature or report a bug?
    This is a bug.

  • What is the current behavior?
    httpBackend.whenRoute() does not parse correctly the path-parameters when they are immediately followed by query-parameters.

    Consider the following example:
    $httpBackend.whenRoute('DELETE', '/api/resource/:_id').respond((method, url, data, header, params) => {}

    If whenRoute is triggered by /api/resource/1?q=hello, params will contain wrong parsing of the id:

    params = {id: '1?q=hello', 'q': 'hello'}

  • What is the expected behavior?
    params = {id: '1', q: 'hello'}

  • What is the motivation / use case for changing the behavior?
    This behaviour looks wrong and inconsistent.

  • Which version of Angular, and which browser and OS does this issue affect? Did this work in previous
    versions of Angular? Please also test with the latest stable and snapshot versions.
    Angular 1.5, in previous releases params was not generated

  • Other information (e.g. detailed explanation, stacktraces, related issues, suggestions how to fix)

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions