CRM-21335 - crmUi - Allow forcing the required `*` flag
authorTim Otten <totten@civicrm.org>
Mon, 23 Oct 2017 21:28:48 +0000 (14:28 -0700)
committerTim Otten <totten@civicrm.org>
Mon, 23 Oct 2017 21:28:48 +0000 (14:28 -0700)
commit3ca16b892cd0e02907bcc623a99e208d3148de38
tree35dbc6a2ce02bfee6e51e81ea56ec4adc64a2b7c
parent7c8d59c50d7bfd254d3d712fd687662ace8279ab
CRM-21335 - crmUi - Allow forcing the required `*` flag

The `crm-ui-field` autodetects whether the element is required by inspecting
the Angular form model. However, in CRM-21335, we have a scenario where this
inspection fails. (There are other possible scenarios -- eg generally, if the
apparent field element is not actually a well-behaved+singular Angular form element.)

This revision adds a new option to make the field *render* as required even
if there's no underlying form ngModel element.

Ex:

```html
<div crm-ui-field="{name: 'subform.recipients', title: ts('Recipients'), required: true}">...</div>
```
ang/crmUi.js
ang/crmUi/field.html