diff --git a/projects/go-style-guide/src/app/features/ui-kit/components/form-docs/components/forms-overview/forms-overview.component.html b/projects/go-style-guide/src/app/features/ui-kit/components/form-docs/components/forms-overview/forms-overview.component.html index 4f5c46ddd..456fe9ba3 100644 --- a/projects/go-style-guide/src/app/features/ui-kit/components/form-docs/components/forms-overview/forms-overview.component.html +++ b/projects/go-style-guide/src/app/features/ui-kit/components/form-docs/components/forms-overview/forms-overview.component.html @@ -5,25 +5,28 @@
- Reactive forms use an explicit and immutable approach to - managing the state of a form at a given point in time. - Each change to the form state returns a new state, which - maintains the integrity of the model between changes. - Reactive forms are built around observable streams, where - form inputs and values are provided as streams of input - values, which can be accessed synchronously. + Reactive forms use an explicit and immutable approach to managing the + state of a form at a given point in time. Each change to the form state + returns a new state, which maintains the integrity of the model between + changes. Reactive forms are built around observable streams, where form + inputs and values are provided as streams of input values, which can be + accessed synchronously.
- Reactive forms differ from template-driven forms in distinct - ways. Reactive forms provide more predictability with - synchronous access to the data model, immutability with - observable operators, and change tracking through observable - streams. If you prefer direct access to modify data in your - template, template-driven forms are less explicit because they - rely on directives embedded in the template, along with mutable - data to track changes asynchronously. + Reactive forms differ from template-driven forms in distinct ways. + Reactive forms provide more predictability with synchronous access to + the data model, immutability with observable operators, and change + tracking through observable streams. If you prefer direct access to + modify data in your template, template-driven forms are less explicit + because they rely on directives embedded in the template, along with + mutable data to track changes asynchronously.
- Form controls have the ability to pass in Validators. In the case of every form input in Goponents we pass a control - thus you may specify on the control passed in to any form input a Validators.required validator on the control. Adding this validator - to any control in Goponents will render a red asterisk next to the label automatically. + Form controls have the ability to pass in Validators. In the case of + every form input in Goponents we pass a control thus you may specify on + the control passed in to any form input a Validators.required validator + on the control. Adding this validator to any control in Goponents will + render a red asterisk next to the label automatically.
-
+
- Form controls have the ability to hold a set of ValidationErrors
. In the case of every form input in Goponents we automatically look for these
- ValidationErrors
and render error text beneath the form element dynamically. This is how form error handling should be done within Goponents.
+ Form controls have the ability to hold a set of
+ ValidationErrors
. In the case of
+ every form input in Goponents we automatically look for these
+ ValidationErrors
and render
+ error text beneath the form element dynamically. These errors are
+ displayed by default, but they can be hidden by setting
+ hideFieldError
input property to
+ true. This is how form error handling should be done within Goponents.
- Angular provides some ValidationErrors
out of the box, Goponents provides default error messages for:
- email
, max
, maxlength
,
- min
, minlength
, required
, and requiredtrue
.
- These will automatically render error messages if the matching Angular Validators are set for the control. If desired, these can be overridden by
- passing a key/value validator with the same name of the Angular one and a custom string as the value.
+ Angular provides some
+ ValidationErrors
out of the box,
+ Goponents provides default error messages for:
+ email
,
+ max
,
+ maxlength
,
+ min
,
+ minlength
,
+ required
, and
+ requiredtrue
. These will
+ automatically render error messages if the matching Angular Validators
+ are set for the control. If desired, these can be overridden by passing
+ a key/value validator with the same name of the Angular one and a custom
+ string as the value.