Added the option to provide a custom function to convert the select2 data to the angular model