Uploaded image for project: 'Alloy'
  1. Alloy
  2. ALOY-665

Using namespace in markup event

    Details

      Description

      Hi,
      I got this error when I use namespace in markup event.

      For example:

      Home.xml

      <Button id="orderButton" onClick="Home.onOrderClick"></Button>
      

      Home.js

      var Home = {}
       
      Home.onOrderClick = function() {
       
      }
      

      I got this error:
      undefined' is not an object (evaluating 'Home.onOrderClick')

      then I opened compiled Home.js and I saw this:

      Home.onOrderClick ? $.__views.orderButton.addEventListener("click", Home.onOrderClick) : __defers["$.__views.orderButton!click!onOrderClick"] = true;
      

      I think you can fixed it with this code

      Home != null && Home.onOrderClick ? $.__views.orderButton.addEventListener("click", Home.onOrderClick) : __defers["$.__views.orderButton!click!onOrderClick"] = true;
      

      Thanks

        Attachments

          Activity

            People

            • Assignee:
              tlukasavage Tony Lukasavage
              Reporter:
              navid_gh Navid Ghahramani
            • Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Backbone Issue Sync

                • Backbone Issue Sync is enabled for your project, but we do not have any synchronization info for this issue.

                  Git Integration