Technical Chamber
  • Contact Us
  • Ask Question
  • Login
Search
Question:
Why component doesn’t display the variable of another component in Angular?

Solution

Make sure that your app.component.html template contains the <app-inner> component. If you aren’t putting it in the template, you’ll unable to select a child with @ViewChild


If your template looks like the following:


<div class="app">app:</div>


Add the following line of code like so the element can be selected


<div class="app">

  app:

  <app-inner></app-inner>

</div>


This >Live Demo will help you understand the code better. 


Suggested blogs:

>What is the Idiomatic way to write a Typescript function with casting

>Why Redux-toolkit payload don't reconigze type in TypeScript?

>TypeScript: Define a type that refers type parameter from another line?

>Solve return type on TypeScript with boolean check doesn't seem to work

>How to fix TS2551: Property toSpliced does not exist on type Array

>Making an argument required if generic interface as no properties

>How to make argument required if generic interface as no properties?

>Cause a type error when a function returns any in TypeScript?

>Library isn’t work in Nestjs useGlobalFilters with library in TypeScript

>How to get the last cell with data for a given column in TypeScript?

>Ignore requests by interceptors based on request content in TypeScript?

>Create data with Typescript Sequelize model without passing in an id?

>How to delete duplicate names from Array in Typescript?


  • Angular
Nisha Patel

Nisha Patel

Submit
0 Answers
Top Questions
06-11-2023

How to access variables in a function using Angular?

04-12-2023

How to Focus shifting between array of standard <input> controls?

01-12-2023

Angular 8.2 Type 'Subscription' is missing the following properties from type

21-11-2023

Why Ng serve doesn't work in Angulars?

12-06-2023

How To Create Nested Table Structure In Angular?

Related Questions

  • Angular
Angular 8.2 Type 'Subscription' is missing the following properties from type
img
Asked 01-12-2023Ritu Singh
  • Angular
A complete guide for CRUD operation in Angular using model popup
img
Asked 12-06-2023Adequate Infosoft
  • Angular
Create a One Page App with Angular.js, Node.js and MongoDB
img
Asked 12-06-2023Adequate Infosoft
  • Angular
How to update properties value with event in template Angular?
img
Asked 17-11-2023Nisha Patel
  • Angular
A Complete Guide To Angular Routing
img
Asked 12-06-2023Adequate Infosoft
Technical Chamber

We genuinely believe coding is an art, and the Technical Chamber is a platform for all coders to come along. At the Technical Chamber, you will find a variety of resources for all skill levels, including tutorials, articles, and resources for all types of coding languages.

Popular Category
  • Node Js
  • AWS
  • ChatGPT
  • Typescript
  • Ajax
Useful Links
  • Write For Us
  • Contact Us
Contact Us
  • The Corenthum, TOWER-A, 2611 , 6th Floor, Sector 62, Noida, Uttar Pradesh 201301
  • contact@adequateinfosoft.com
  • +91- 0120 419 8878

Copyright © 2023 Technical Chamber. All Right Reserved

  • Write For Us
  • Ask Question
  • Contact Us