ItSolutionStuff.com

Angular - Cannot find name 'Input' - Solved

By Hardik Savani • May 2, 2024
Angular

Today, Cannot find name 'Input' in angular is our main topic. I explained simply step by step angular error ts2304 cannot find name 'Input'. I explained simply step by step angular cannot find Input error. This tutorial will give you simple example of angular cannot find name Input.

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

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

Solution:

let's import Input from @angular/core npm package, as bellow:

Import Input:

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

Let's see bellow working code:

Example:

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

@Component({

selector: 'app-post',

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

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

})

export class PostComponent{

@Input() title: string;

}

I hope it can help you...

Tags: Angular
Hardik Savani

Hardik Savani

I'm a full-stack developer, entrepreneur, and founder of ItSolutionStuff.com. Passionate about PHP, Laravel, JavaScript, and helping developers grow.

📺 Subscribe on YouTube

We Are Recommending You

Angular - How to Set Headers in Httpclient Request?

Read Now →

Angular Material Checkbox Change Size Example

Read Now →

Angular Stripe Payment Gateway Integration Tutorial

Read Now →

Angular 13 Stripe Payment Integration Example

Read Now →

Angular 13 Login with Google / Gmail Account Tutorial

Read Now →

Angular 13 Google Maps Integration Example

Read Now →

Angular 13 Reactive Forms Validation Tutorial Example

Read Now →

Angular Material Select Dropdown with Search Example

Read Now →

Angular Get Difference Between Two Dates in Days

Read Now →

Angular Owl Carousel/Slider Example Tutorial

Read Now →

Angular Material Copy to Clipboard Example

Read Now →