Allows use an anonymous function to set the label of the attribute.

Useful when we need the label to be dynamic according to the model.