Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
SamprithaUdaikumar opened this issue Apr 19, 2022 · 0 comments

Comments

@SamprithaUdaikumar
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant