Skip to content

Commit 30067b0

Browse files
committed
docs(component-guide): update output target config steps
1 parent 15c3ac8 commit 30067b0

File tree

1 file changed

+33
-13
lines changed

1 file changed

+33
-13
lines changed

docs/component-guide.md

Lines changed: 33 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -849,6 +849,24 @@ export {
849849
850850
This ensures your component is properly exported and available for use in standalone Angular applications.
851851
852+
#### Output Target Configuration
853+
854+
Update the `angularOutputTarget` configuration in [`stencil.config.ts`](/core/stencil.config.ts) to exclude your new component from the generated proxies. This is necessary because value accessors for these components are manually implemented in the standalone package.
855+
856+
```typescript
857+
angularOutputTarget({
858+
// ... other config
859+
excludeComponents: [
860+
...excludeComponents,
861+
// ... other excludes
862+
/**
863+
* Value Accessors are manually implemented in the `@ionic/angular/standalone` package.
864+
*/
865+
'ion-new-component'
866+
]
867+
})
868+
```
869+
852870
### Angular Tests
853871
854872
Add tests for the new component to the existing Angular test files:
@@ -871,27 +889,29 @@ These files contain tests for form integration and input behavior. Review how si
871889
872890
#### Output Target Configuration
873891
874-
Update the `vueOutputTarget` configuration in `stencil.config.ts` to include the new component:
892+
Update the `vueOutputTarget` configuration in [`stencil.config.ts`](/core/stencil.config.ts):
875893
876-
```typescript
894+
- Add your new component to the appropriate `componentModels` array, based on its behavior:
895+
- For boolean inputs, add to the array with `targetAttr: 'checked'` and `event: 'ion-change'`
896+
- For select-like inputs, add to the array with `targetAttr: 'value'` and `event: 'ion-change'`
897+
- For text/numeric inputs, add to the array with `targetAttr: 'value'` and `event: 'ion-input'`
898+
899+
For example, if your component is a text input, add it to:
900+
```js
877901
vueOutputTarget({
878902
// ... other config
879903
componentModels: [
904+
// ... other models
880905
{
881-
elements: ['ion-new-component'],
882-
targetAttr: 'value', // or 'checked' for boolean inputs
883-
event: 'ion-input', // or 'ion-change' depending on the component
906+
elements: ['ion-input', 'ion-input-otp', 'ion-searchbar', 'ion-textarea', 'ion-range', 'ion-new-component'],
907+
targetAttr: 'value',
908+
event: 'ion-input',
884909
}
885-
]
886-
})
910+
],
911+
}),
887912
```
888913
889-
Choose the `targetAttr` and `event` based on your component's behavior:
890-
- For text/numeric inputs: Use `targetAttr: 'value'` and `event: 'ion-input'` (like `ion-input` and `ion-textarea`)
891-
- For boolean inputs: Use `targetAttr: 'checked'` and `event: 'ion-change'` (like `ion-checkbox` and `ion-toggle`)
892-
- For select-like inputs: Use `targetAttr: 'value'` and `event: 'ion-change'` (like `ion-select` and `ion-radio-group`)
893-
894-
Look at similar components in the [Vue output target configuration](/core/stencil.config.ts) to see which values they use.
914+
Look at similar components in the `componentModels` arrays to determine the correct placement.
895915
896916
### Vue Tests
897917

0 commit comments

Comments
 (0)