Implement cross-cutting functionality with Angular Formly Extensions

Share this video with your friends

Send Tweet

Assume we want to add a data-cy attribute to all of our form controls. We need this as a hook to later be able to easily grab our input fields from within our Cypress integration tests. Of course we could manually add these data- attributes to each of our formly field configuration. But there's a much more elegant approach: extensions. In this lesson we're going to see how they work.

Erkan Buelbuel
Erkan Buelbuel
~ 3 years ago

Fyi, everything works fine except ng-select; it does not get the data-cy attribute.