[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
exportsas well:index.xml
index.js
var nested = { doClick: function(e) { alert($.label.text); } }; $.index.open();