@@ -167,15 +167,6 @@ class IgxCustomNgElementStrategy extends ComponentNgElementStrategy {
167167 // TODO(D.P.): Temporary maintain pre-check for ngAfterViewInit handling on _init flag w/ ngDoCheck interaction of row island
168168 ( this as any ) . componentRef . changeDetectorRef . detectChanges ( ) ;
169169
170- // check if there are any content children associated with a content query collection.
171- // if no, then just emit the event, otherwise we wait for the collection to be updated in updateQuery.
172- const contentChildrenTypes = this . config . filter ( x => contentChildrenTags . indexOf ( x . selector ) !== - 1 ) . map ( x => x . provideAs ?? x . component ) ;
173- const contentQueryChildrenCollection = componentConfig . contentQueries . filter ( x => contentChildrenTypes . includes ( x . childType ) ) ;
174- if ( contentQueryChildrenCollection . length === 0 ) {
175- // no content children, emit event immediately, since there's nothing to be attached.
176- ( this as any ) . componentRef ?. instance ?. childrenAttached ?. emit ( ) ;
177- }
178-
179170 if ( parentAnchor && parentInjector ) {
180171 // attempt to attach the newly created ViewRef to the parents's instead of the App global
181172 const parentViewRef = parentInjector . get < ViewContainerRef > ( ViewContainerRef ) ;
@@ -218,6 +209,15 @@ class IgxCustomNgElementStrategy extends ComponentNgElementStrategy {
218209 this . patchGridPopups ( ) ;
219210 }
220211
212+ // check if there are any content children associated with a content query collection.
213+ // if no, then just emit the event, otherwise we wait for the collection to be updated in updateQuery.
214+ const contentChildrenTypes = this . config . filter ( x => contentChildrenTags . indexOf ( x . selector ) !== - 1 ) . map ( x => x . provideAs ?? x . component ) ;
215+ const contentQueryChildrenCollection = componentConfig ?. contentQueries ?. filter ( x => contentChildrenTypes . includes ( x . childType ) ) ;
216+ if ( ! contentQueryChildrenCollection ?. length ) {
217+ // no content children that will trigger query updates, emit event immediately.
218+ ( this as any ) . componentRef ?. instance ?. childrenAttached ?. emit ( ) ;
219+ }
220+
221221 // instead of duplicating super.disconnect() w/ the scheduled destroy:
222222 componentRef . onDestroy ( ( ) => {
223223 if ( this . _templateWrapperRef ) {
0 commit comments