Skip to content
This repository was archived by the owner on May 1, 2025. It is now read-only.
This repository was archived by the owner on May 1, 2025. It is now read-only.

selectParams of Angular Router Store is capturing more than the specified string #810

@SamprithaUdaikumar

Description

@SamprithaUdaikumar

Is this a regression?

No

Description

routerQuery.selectParams<string('draftId') is selecting the draftId and the queryParam from the route.

sample code we used to access the params

this.draftId$ = this.routerQuery .selectParams<string>('draftId') .pipe( filter((id) => !!id), distinctUntilChanged() );

Please provide a link to a minimal reproduction of the bug

No response

Please provide the exception or error you saw

No exception.

Please provide the environment you discovered this bug in

Ionic:

   Ionic CLI                     : 6.19.0
   Ionic Framework               : @ionic/angular 6.0.13
   @angular-devkit/build-angular : 13.2.6
   @angular-devkit/schematics    : 13.2.6
   @angular/cli                  : 13.2.6
   @ionic/angular-toolkit        : 6.1.0

Capacitor:

   Capacitor CLI      : 3.4.3
   @capacitor/android : 3.4.3
   @capacitor/core    : 3.4.3
   @capacitor/ios     : 3.4.3

Cordova:

   Cordova CLI       : 11.0.0
   Cordova Platforms : not available
   Cordova Plugins   : not available

Utility:

   cordova-res : 0.15.4
   native-run  : 1.5.0

System:

   ios-deploy : 1.11.4
   ios-sim    : 8.0.2
   NodeJS     : v16.14.2 
   npm        : 8.5.0
   OS         : macOS Big Sur
   Xcode      : Xcode 13.2.1 Build version 13C100

Anything else?

We tried using

import { RouterQuery } from '@datorama/akita-ng-router-store';

export class ArticlesQuery extends QueryEntity<ArticlesState> {
   constructor(protected store: ArticlesStore, 
              private routerQuery: RouterQuery) {
     routerQuery.selectFragment().subscribe();
     routerQuery.selectFragment('id').subscribe();
     routerQuery.selectFragment(['id', 'type']).subscribe();
   }
 }
 

Here the selectFragment would not allow us to specify a parameter.
it shows an exception "Expected 0 arguments , but got 1"

Do you want to create a pull request?

No

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions