Closed
Description
This code will call the custom
function:
value:
label: 'Value'
type: String
custom: ->
console.log 'in custom'
console.log this
return undefined
This will not:
value:
label: 'Value'
type: SimpleSchema.oneOf(String, Boolean)
custom: ->
console.log 'in custom'
console.log this
return undefined
Edit: Original written in CoffeeScript, but easy to convert
value: {
label: 'Value',
type: TRY_STRING_OR_ONEOF,
custom: function () {
// This runs when type == String, but not when SimpleScheme.oneOf
console.log('in custom')
console.log(this)
return undefined
}
}