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: `
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.
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)…
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.
Specialka
  • 51
  • 1
  • 10
0
votes
1 answer

Angular: possible to queries elements of all DOM from a specific component?

With the DOM snippets below: I would like from ng-comp3 to list all components ng-comp1 in DOM document. There is a way for…
clem
  • 799
  • 9
  • 20
0
votes
1 answer

Detect Click Outside of Element Angular 9 - Multiple Instances

In my app, on click of an element I am showing a tooltip that contains additional information. This is available for all elements in a list. I would like to be able to close the expansion on click of anything outside of the tooltip. The concept is…
0
votes
0 answers

Angular 8: await till son component is created

I have a 'father' component which has few 'son-s' components. The 'father' creates 'sons' by the following code: export class FatherComponent implements OnInit, AfterViewInit { @ViewChildren(SonComponent, { read: ViewContainerRef })…
Zvi Vered
  • 459
  • 2
  • 8
  • 16
0
votes
0 answers

ViewQuery ViewChildren nested Components

I have a situation like this HereIWantViewChildrenComp <- @ViewChilren(QueryCmp) //is undefined :-( | | | AComp BComp CComp <- They are in the View of HereIWantViewChildrenComp | | | QueryCmp QueryCmp…
Andre Elrico
  • 10,956
  • 6
  • 50
  • 69