diff --git a/projects/igniteui-angular-elements/src/analyzer/elements.config.ts b/projects/igniteui-angular-elements/src/analyzer/elements.config.ts index 05c86c74b99..9f7913c4229 100644 --- a/projects/igniteui-angular-elements/src/analyzer/elements.config.ts +++ b/projects/igniteui-angular-elements/src/analyzer/elements.config.ts @@ -48,7 +48,13 @@ export var registerConfig = [ IgxHierarchicalGridComponent, IgxRowIslandComponent, ], - contentQueries: [], + contentQueries: [ + { + property: "actionButtons", + childType: IgxActionStripActionsToken, + isQueryList: true, + }, + ], additionalProperties: [{ name: "cdr", writable: true }], methods: ["show", "hide"], boolProps: ["hidden"], diff --git a/projects/igniteui-angular-elements/src/app/custom-strategy.spec.ts b/projects/igniteui-angular-elements/src/app/custom-strategy.spec.ts index 3521e662dab..a761729e2fd 100644 --- a/projects/igniteui-angular-elements/src/app/custom-strategy.spec.ts +++ b/projects/igniteui-angular-elements/src/app/custom-strategy.spec.ts @@ -1,4 +1,4 @@ -import { IgxColumnComponent, IgxGridComponent, IgxHierarchicalGridComponent } from 'igniteui-angular'; +import { IgxActionStripComponent, IgxColumnComponent, IgxGridComponent, IgxHierarchicalGridComponent } from 'igniteui-angular'; import { html } from 'lit'; import { firstValueFrom, fromEvent, skip, timer } from 'rxjs'; import { ComponentRefKey, IgcNgElement } from './custom-strategy'; @@ -235,6 +235,23 @@ describe('Elements: ', () => { expect(grid.getColumnByVisibleIndex(1).field).toEqual('ProductName'); }); + it('should populate action strip actionButtons content query.', async () => { + const innerHtml = ` + + + + + `; + testContainer.innerHTML = innerHtml; + + // TODO: Better way to wait - potentially expose the queue or observable for update on the strategy + await firstValueFrom(timer(10 /* SCHEDULE_DELAY */ * 3)); + + const actionStrip = document.querySelector('#testStrip'); + const actionStripComponent = (await actionStrip.ngElementStrategy[ComponentRefKey]).instance as IgxActionStripComponent; + expect(actionStripComponent.actionButtons.toArray().length).toBeGreaterThan(0); + }); + it('should not destroy action strip when row it is shown in is destroyed or cached.', async() => { const innerHtml = ` diff --git a/projects/igniteui-angular/action-strip/src/action-strip/action-strip.component.ts b/projects/igniteui-angular/action-strip/src/action-strip/action-strip.component.ts index adef5b6e482..d56215f99d8 100644 --- a/projects/igniteui-angular/action-strip/src/action-strip/action-strip.component.ts +++ b/projects/igniteui-angular/action-strip/src/action-strip/action-strip.component.ts @@ -134,7 +134,7 @@ export class IgxActionStripComponent implements IgxActionStripToken, AfterViewIn * @hidden * @internal */ - @ContentChildren(IgxActionStripActionsToken as any) + @ContentChildren(IgxActionStripActionsToken) public actionButtons: QueryList; /**