Skip to content
1 change: 1 addition & 0 deletions renderers/angular/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
## Unreleased

- (v0_9) Implement `createAngularComponentImplementation` helper and deprecate `extraComponents` in `BasicCatalogOptions` to align with the core API. [#2060](https://github.com/a2ui-project/a2ui/pull/2060)
- Standardize package entry points to `index.ts` while maintaining `public-api.ts` wrappers for backward compatibility.
- (v0_8) Export `A2uiMessageSchema` in public API.

Expand Down
2 changes: 2 additions & 0 deletions renderers/angular/src/v0_9/catalog/basic/basic-catalog.ts
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,8 @@ export interface BasicCatalogOptions {
/**
* Optional additional components to include in the catalog beyond
* the standard basic catalog components.
*
* @deprecated Use AngularCatalog constructor directly to combine BASIC_COMPONENTS with custom ones.
*/
extraComponents?: AngularComponentImplementation[];

Expand Down
48 changes: 48 additions & 0 deletions renderers/angular/src/v0_9/catalog/types.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
/**
* Copyright 2026 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

import {Component, signal} from '@angular/core';
import {ComponentApi} from '@a2ui/web_core/v0_9';
import {createAngularComponentImplementation} from './types';
import {CatalogComponentInstance} from '../core/catalog_component_instance';
import {z} from 'zod';

@Component({
selector: 'test-comp',
template: '',
standalone: true,
})
class TestComponent implements CatalogComponentInstance {
readonly props = signal<Record<string, unknown>>({});
readonly surfaceId = signal('');
readonly componentId = signal('');
readonly dataContextPath = signal('');
Comment thread
josemontespg marked this conversation as resolved.
Outdated
}

describe('createAngularComponentImplementation', () => {
it('should map ComponentApi and Angular Component Type correctly', () => {
const api: ComponentApi = {
name: 'TestComp',
schema: z.object({}),
};

const impl = createAngularComponentImplementation(api, TestComponent);

expect(impl.name).toBe('TestComp');
expect(impl.schema).toEqual(api.schema);
expect(impl.component).toBe(TestComponent);
});
});
11 changes: 11 additions & 0 deletions renderers/angular/src/v0_9/catalog/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,3 +49,14 @@ export interface AngularComponentImplementation extends ComponentApi {
* correct Angular components.
*/
export class AngularCatalog extends Catalog<AngularComponentImplementation> {}

export function createAngularComponentImplementation(
Comment thread
josemontespg marked this conversation as resolved.
Outdated
Comment thread
josemontespg marked this conversation as resolved.
Outdated
Comment thread
josemontespg marked this conversation as resolved.
Outdated
api: ComponentApi,
component: Type<CatalogComponentInstance>,
): AngularComponentImplementation {
return {
name: api.name,
schema: api.schema,
component,
};
Comment thread
josemontespg marked this conversation as resolved.
}
Loading