Error: This function is not compatible with pMap.get

Encountering an error message when trying to compile the datatable using generics:

"TypeError: pMap.get is not a function"

Code:

import { has,HashMap, map } from '@typed/hashmap';
import { element, promise } from 'protractor';

var pMap = new Map();
export class ParamManager {


    //async dt(dataTable ):Promise<ElementFinder> {
     dt(datatable )  {
        //let result = new Map();
        //var pMap = new Map();
          var result=datatable.rowsHash();

        //for (Map<String, String> data : arg1.asMaps(String.class, String.class)) {
        // result.map((item) => {

        //      pMap=item

        let tempArray=[];
        tempArray.push(result);
         tempArray.forEach(element=>{
            //element.get().toString().trim();
            pMap=element;
         } );
        // result.array.forEach(element => {
        //  element.get(0).toString().trim();
        console.log(pMap)
    }




      public getParam( key:any) :Promise<any>{
         return pMap.get(key);
    }

}

Answer №1

import { contains, HashMap, Map } from '@typed/hashmap';

Always double check the imported map statement to ensure it's capitalized as Map

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

What could be the reason for the title template not being implemented in the Next.js metadata for my homepage?

Currently, I am in the process of developing a Next.js project and working on setting dynamic metadata for various pages. Specifically, I want to display the title of my homepage as "Home | My Website", but unfortunately it is only showing as "Home". Below ...

Cannot access assets: Angular 8 deployment on Tomcat 9.0.30 is prevented due to an invalid MIME type ("text/html")

I am currently working on a project that involves an angular 8 user interface and a springboot java backend. The project is structured as a multi module project, with the angular portion in a separate module. To build the angular code into a single executa ...

Utilize a jest mock object and pass it as a method parameter to achieve seamless testing

I am attempting to create a mock object (ColumnApi from ag-grid) using jest and then pass it as a parameter to a function that calls the "getAllColumns" method from ColumnApi. I am not concerned with how the "getAllColumns" method functions, but I want it ...

Can a type be referenced using the generic name?

My selection includes: export type DocumentType = | Item | List | User export type DocumentInputType = | ItemInputType | ListInputType | UserInputType I want to develop a feature that can determine the input type based on the document type wi ...

How can you display a loading indicator after a delay using Observables, but make sure to cancel it if the loading is completed

Within my customer-detail component, I have implemented code that achieves the desired outcome. However, I believe there might be a more reactive and observable way to approach this task. Instead of using an if statement to set this.isLoading = true;, is ...

Using the `infer` keyword to deduce a type parameter in a generic function

When working with TypeScript, it is possible for a generic function to be automatically generated if one of the parameters is a type parameter from another generic function. This can happen without explicitly defining it as a generic. export function fn< ...

Detecting when users stop scrolling in Angular 5

Is there a way to toggle visibility of a div based on user scrolling behavior? I'd like the div to hide when the user scrolls and reappear once they stop. I've attempted to achieve this effect using @HostListener, but it only seems to trigger wh ...

Step-by-step guide to creating an nx workspace using Angular 14

Transitioning to an nx workspace with 2 apps and 2 libraries, all utilizing angular version 14, has been a challenge due to being locked into this version for compatibility with ionic 5. Despite various attempts to set up the workspace, I have yet to succe ...

Tips for breaking a line in Angular flex-layout to ensure components are displayed on a new line:

I currently have a layout structured like this: <div fxLayout="row" fxFill fxLayoutAlign="start start"> <app-comp1 class="comp"></app-comp1> <app-comp2 class="comp></app-comp2> <app-comp3 class="comp"></ ...

Tips for defining an array containing only one alias that has been declared in a type alias

Suppose I have declared a type alias in TypeScript like this: export type PlatformType = 'em' | 'ea' | 'hi'; How can I specify a property in an interface that only accepts an array containing one instance of each PlatformType ...

Angular is used to send an HTTP GET request

I'm seeking assistance with implementing a get and put request in Angular. I understand how to initiate a get or put request when a button is clicked, by binding the request to the button itself. However, I am now looking for a way to trigger a get re ...

Chrome stack router outlet and the utilization of the Angular back button

I'm experiencing an issue with the back button on Chrome while using Angular 14. When I return to a previous page (URL), instead of deleting the current page components, it keeps adding more and more as I continue to press the back button (the deeper ...

Issue with displaying ngFor in map marker information for Ionic 2/Angular 2

I am encountering an issue while trying to display data on my map marker's infowindow. Although I successfully retrieved the data in the console, I am facing difficulties in displaying it on the infowindow. The marker and infowindow are visible on the ...

Issue with updating the div to show the user's submission form in Angular is causing difficulties

After a user submits a form, I would like to display their submission by hiding the form area and showing the response in that same area. Upon submitting the form, my goal is to show a mat-spinner until a response is received from the server. The compone ...

TypeScript error: The argument '{ }' cannot be assigned to the parameter '{ }' when using MongoStore

I'm still getting the hang of TS and I've run into a type issue with the parameters for new MongoStore(). In JavaScript, I can usually reuse the Native MongoDB connection by simply passing db: database as an argument, but TypeScript is throwing t ...

Steps for updating the title of a dialog box once it has been opened

When opening the dialog: let dialogRef = dialog.open(UserProfileComponent, { height: '400px', width: '600px', }); The dialog content: <h2 mat-dialog-title>Dele ...

Creating multiple relationships in TypeORM for entities with private properties

In my node application, I am utilizing the typeorm library for entity mapping. My goal is to establish multiple type relations between entities. While following the documentation, I noticed that the entity properties are marked as public, allowing access f ...

Modifying the <TypescriptModuleKind> setting for typescript transpilation in project.csproj is not supported in Visual Studio 2017

I recently encountered an issue with changing the module kind used by the transpiler in Visual Studio. Despite updating the <TypescriptModuleKind> in the project's project.csproj file from commonjs to AMD, the transpiler still defaults to using ...

Ng2-smart-table is experiencing difficulty showing date and time values when used on Internet Explorer

In my Angular 7 application, I am utilizing ng2-smart-table. Within the table, I have incorporated the owl-datetime picker for selecting date and time values to be added to the database. The data is retrieved from the backend in an array format and then d ...

Transitioning from Angular's promises to Observables (RxJS) for making repetitive API calls to a single endpoint

I am facing an issue while working with Angular and I am seeking a solution using Observables instead of Promises (async/await) which I am currently using. The API endpoint allows sorting and pagination by passing parameters like pageSize and page to fetc ...