[ALOY-645] onClick="nested.object.here" throws errors in Alloy
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Medium |
Status | Closed |
Resolution | Invalid |
Resolution Date | 2014-01-21T19:33:22.000+0000 |
Affected Version/s | n/a |
Fix Version/s | 2014 Sprint 02 |
Components | n/a |
Labels | Alloy |
Reporter | Daniel Sefton |
Assignee | Tony Lukasavage |
Created | 2013-04-28T00:38:36.000+0000 |
Updated | 2014-01-28T23:55:22.000+0000 |
Description
As discussed here: http://developer.appcelerator.com/question/151438/coffeescript-with...
using
<... onClick="nested.object">
throws errors because the generated code includes
$.nested.object ? ...
and this is defined above the user's controller!
you should use something like like this:
_.get('nested.object')
which is available https://npmjs.org/package/underscore.nested
The following code works just fine, and works exactly the same if you prefix the event handler name and function declaration with
exports
as well:index.xml
index.js
There are no inherent errors with using namespaces as event handlers from your views. Alloy does not officially support coffeescript and the code generation and handling won't be changed to support it at the potential expense of stability of existing code written in pure JS.