I have been trying to define directives so I can display different \"widgets\" in a form, depending on the type of field and its parameters, which are stored in a database.
You mean something like this ?
I basically use @Flek's example.
The only difference being ng-model='title'
The trick to doing two-way binding is ng-model, and it states in the document:
ngModel is directive that tells Angular to do two-way data binding. It works together with input, select, textarea. You can easily write your own directives to use ngModel as well.