I'm working on my first afform extension.
I've built a form, which works! I can submit values and create a contact.
However, I can't figure out how to pre-populate with default values. This is pretty important for the application. I've tried a number of things but none of them seem to work (not even the 'defn` one which came from a published example). Any suggestions? Note: I don't want to populate the form with the values from an existing contact. I need to insert new values into the form so when submitted, it creates a new contact.
<af-form ctrl="modelListCtrl">
<af-entity type="Contact" name="member" label="Member" />
<div af-fieldset="member">
<af-field name="first_name" ng-init="first_name = 'Betty'" />
<af-field name="last_name" value="Smith" />
<af-field name="do_not_email" defn="{type: 'checkbox', default: 1}" />
</div>
<button ng-click="modelListCtrl.submit()">Submit</button>
</af-form>