Closed heyotwell closed 13 years ago
${getName()} will call the function, but the context of the call will not be $data, so the 'this' will not be the data object, but the templateItem, so you would need to do this.data.firstName in the function. If you are using this.firstName (or similar) in the function, then, yes, ${$data.getName()} is the right way to call the function, so that the 'this' context it the data item.
I'd like to be able to use functions attached to my data objects like this:
To access the getName() function in a template, I have to refer to it by $item.data.getName() or $data.getName() format, though other attributes are available by ${firstName} syntax. Is this correct?