Questions tagged [viewchildren]
31 questions
0
votes
0 answers
When using ViewChildren with ngFor in an Angular 15 app you don't get the children
I have a simple Angular 15 app and ViewChildren is not working, even with a setTimeout() within ngAfterViewInit, in which I subscribe to changes of the ViewChildren instance:
app.component.html

Greg Lafrance
- 768
- 1
- 7
- 18
0
votes
2 answers
Acces @ViewChild NgForm refence from child components in parent component
I have following app structure:
+--------------------------------------------+
| Parent | …

karlitos
- 1,604
- 3
- 27
- 59
0
votes
0 answers
Angular: Get ViewChildren inside of directive
I have a component called SomeComponent. This component contains some Elements like a paragraph which has a template reference variable attached to it. Here is an example of SomeComponent
@Component({
selector: "some-component",
template: `

Mark Heimer
- 49
- 6
0
votes
0 answers
using child components formgroup with @ViewChildren
I have a parent component in which I am trying to disable a button if form in child component is not valid. I am using @ViewChildren decorator but its seems to be not working properly.
parent.component.html

dudu1234
- 3
- 4
0
votes
1 answer
I'm trying to access a query list of child directive from a parent directive in the after view init method but the querylist remains undefined
QueryList of child directives remains undefined in ngAfterViewInit lifecycle hook.
What i'm I missing?
Here my code:
app.component.html
Main content
Main content
Main content
…
Sam L
- 1
0
votes
0 answers
renderer innerHTML dynamically and set string interpolation within it
I am trying to change the innerHTML of each row in a table according to the current uploading file. I query the rows with QueryList from ViewChildren. Then I tried to change the innerHTML
within the function according to the current upload file.…

MD40
- 157
- 2
- 13
0
votes
0 answers
Dynamically Resolved Component showing Wrong value in prod
I am using a splitter(kendo splitter) to render two child component into a parent component at once.

Wasif Mustahid
- 144
- 9
0
votes
1 answer
Module not found: Error: Can't resolve '@angular/core/src/render3': ViewChildren QueryList
(Angular CLI: 1.7.4)
I am using ViewChildren in a component. It is working fine if I define it as
@ViewChildren(TestComponent) testComponents;
However, when I specify the type of testComponents as QueryList:
@ViewChildren(TestComponent)…

Abhyuday Singh
- 11
- 2
0
votes
1 answer
Access to child component reference for Angular @ViewChildren
I'm creating a number of ModuleItemComponents using the following Angular markup:
and the…

Ivan Pelly
- 147
- 2
- 12
0
votes
1 answer
@ViewChild component undefined when trying to call async variable
I used @ViewChildren component:
@ViewChildren("MyTest2Component") public myTest2Component: QueryList
public ngAfterViewInit() {
this.myTest2Component.changes.subscribe((comps: QueryList ) =>
{
…

Mahdi
- 307
- 6
- 19
0
votes
0 answers
How to color paint a table in Angular?
Here is the rub. I need to color cells in a html table.
The table is made by a ngFor and is 7 column wide. Each column is a component created by the ngFor.