Angular - Cannot find name 'HttpParams' - Solved

By Hardik Savani May 31, 2023 Category : Angular

This tutorial will give you example of Cannot find name 'HttpParams' in angular. I explained simply about angular error ts2304 cannot find name 'HttpParams'. you will learn angular cannot find HttpParams error. you can understand a concept of angular cannot find name HttpParams. Let's see bellow example solve cannot find name HttpParams angular error.

You can use this solution with angular 8, angular 9, angular 10, angular 11, angular 12, angular 13, angular 14, angular 15 and angular 16 version.

In this post, I will give you the solution of "Cannot find name 'HttpParams'" in angular application. we need to import HttpParams from @angular/common/http library. so let's see below the solution and full code.


let's import HttpParams from @angular/common/http npm package, as bellow:

Import HttpParams:

import { HttpParams } from '@angular/common/http';

Let's see bellow working code:


import { Component } from '@angular/core';

import { HttpClient, HttpParams } from '@angular/common/http';


selector: 'app-root',

templateUrl: './app.component.html',

styleUrls: ['./app.component.css']


export class AppComponent {

title = 'fullcal';



Define constructor



constructor(private http: HttpClient) {}



Define ngOnInit()



ngOnInit() {

let auth_token = "asasa21212....";

let params = new HttpParams();

params = params.append('_page', 1);

params = params.append('_limit', 10);

const requestOptions = { params: params };


.get('http://localhost:8001/events.php', requestOptions)

.subscribe((res: any) => {





I hope it can help you...

Tags :