Adding a templateResult function with data-* attributes

How can I (Is it possible) add a templateResult function in-line with data-* attributes?

I’ve tried with this (slightly simplified):

<select data-tags="true" data-template-result="function(selection) {return selection.text;}">
...
</select>

Sorry, Select2 does not support what you’ve described.