Greetings! I am currently in the process of migrating an Angular application from version 8 to 9. As I tackle and resolve various errors, there is one particular issue that spans across multiple lines of code.
ERROR in angularApp/app/my-trades/my-trades.component.ts:2045:34 - error TS2339: Property 'get' does not exist on type 'unknown'.
This is where the error manifests:
private paginate() {
this.route.queryParamMap.pipe(
map(params => params.get('page'))) // here it underlines get
.subscribe(page => {
if (page) {
this.config.currentPage = Number(page);
};
});
}
Here is my package.json configuration:
{
"name": "project.vision",
"version": "1.0.3",
"scripts": {
...
},
"dependencies": {
...
},
"devDependencies": {
...
},
"browser": {
"image-size": false
},
"peerDependencies": {
...
}
}
Below are the imports in my code:
import { auditTime, debounceTime, filter } from 'rxjs/operators';
import { Component, OnInit, ChangeDetectorRef, ViewEncapsulation, OnDestroy, Injector, HostListener } from '@angular/core';
...
@Component({
selector: 'my-trades-component',
styleUrls: ['./my-trades.component.scss'],
providers: [ContextService, Functions, UserContextProvider],
templateUrl: 'my-trades.component.html',
encapsulation: ViewEncapsulation.None,
})