Two-way binding/ngModel using Angular #1439
Replies: 5 comments 5 replies
-
It should work just fine? Angular binds to dom properties so it should work well with web components. Are you having a particular issue? |
Beta Was this translation helpful? Give feedback.
-
Hi! I've never seen shoelace before, but you can read how to work with WebComponents in Angular here: https://angular.io/guide/elements |
Beta Was this translation helpful? Give feedback.
-
ngDefaultControl directive can be used for simple form controls, but if you need more complex functionality, you will need to implement a custom ControlValueAccessor. You can refer this article for how to implement CVA for custom component :https://coryrylan.com/blog/using-web-components-in-angular-forms-with-element-internals |
Beta Was this translation helpful? Give feedback.
-
In addition to the other suggestions, there are some potentially helpful responses to my tweet here. |
Beta Was this translation helpful? Give feedback.
-
In a project I'm working in we've followed the exact same concept of Shoelace's React wrappers to build Angular wrappers: These wrappers make it possible to provide all special Angular syntax for models, event listeners, methods etc. including TypeScript/intellisense support (I'm personally not an Angular user, maybe some stuff could be improved here): (Note: Our prefix is @claviska Would you be interested in a PR to provide Angular wrappers in addition to your React wrappers? |
Beta Was this translation helpful? Give feedback.
-
Please guys, how are you handling the data binding when using web-components and Angular? Is it possible to have two-way binding or use ngModel?
Beta Was this translation helpful? Give feedback.
All reactions