I have a select element in my html bound to an ng-model.
Something like this example:
My accountTypes would look like this:
accountTypes:[
{ name:'Individual', value: 1, title: 'Individual Account'},
{ name: 'Joint', value: 2, title: 'Joint Account'}
];
How can I achieve the final markup to look like this once the model is bound:
Individual
Joint
PS: jQuery hacks appreciated but my ideal solution would something (jQuery, DOM-modification)less.
解决方案
ngOptions doesn't currently support title. Instead, use a ngRepeat on an options tag, or (harder) extend ngOptions to support your needs.