{"action":"created","issue":{"url":"https://api.github.com/repos/NativeScript/NativeScript/issues/2143","repository_url":"https://api.github.com/repos/NativeScript/NativeScript","labels_url":"https://api.github.com/repos/NativeScript/NativeScript/issues/2143/labels{/name}","comments_url":"https://api.github.com/repos/NativeScript/NativeScript/issues/2143/comments","events_url":"https://api.github.com/repos/NativeScript/NativeScript/issues/2143/events","html_url":"https://github.com/NativeScript/NativeScript/issues/2143","id":155666193,"number":2143,"title":"Tap with Parameters/Arguments","user":{"login":"leocaseiro","id":940070,"avatar_url":"https://avatars.githubusercontent.com/u/940070?v=3","gravatar_id":"","url":"https://api.github.com/users/leocaseiro","html_url":"https://github.com/leocaseiro","followers_url":"https://api.github.com/users/leocaseiro/followers","following_url":"https://api.github.com/users/leocaseiro/following{/other_user}","gists_url":"https://api.github.com/users/leocaseiro/gists{/gist_id}","starred_url":"https://api.github.com/users/leocaseiro/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/leocaseiro/subscriptions","organizations_url":"https://api.github.com/users/leocaseiro/orgs","repos_url":"https://api.github.com/users/leocaseiro/repos","events_url":"https://api.github.com/users/leocaseiro/events{/privacy}","received_events_url":"https://api.github.com/users/leocaseiro/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/NativeScript/NativeScript/labels/T:Question","name":"T:Question","color":"fbca04"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":8,"created_at":"2016-05-19T06:54:22Z","updated_at":"2016-05-19T08:45:58Z","closed_at":"2016-05-19T07:41:04Z","body":"Hi, I'd like to pass some parameters to my tap event, similar vanilla javascript in the browser.\r\n\r\nExample:\r\n```xml\r\n<Button tap=\"doSomething(myObject)\" />\r\n```\r\n\r\nThan, in javascript I would do, similar to:\r\n```javascript\r\nexports.doSomething = function(myObject) {\r\n    console.log('param1', myObject.param1);\r\n};\r\n```\r\n\r\nPS: I've tried args.view, but it get's me all the page, I also tried to add as a resource, but it happens before each tap.\r\n\r\nThanks"},"comment":{"url":"https://api.github.com/repos/NativeScript/NativeScript/issues/comments/220263783","html_url":"https://github.com/NativeScript/NativeScript/issues/2143#issuecomment-220263783","issue_url":"https://api.github.com/repos/NativeScript/NativeScript/issues/2143","id":220263783,"user":{"login":"enchev","id":5804953,"avatar_url":"https://avatars.githubusercontent.com/u/5804953?v=3","gravatar_id":"","url":"https://api.github.com/users/enchev","html_url":"https://github.com/enchev","followers_url":"https://api.github.com/users/enchev/followers","following_url":"https://api.github.com/users/enchev/following{/other_user}","gists_url":"https://api.github.com/users/enchev/gists{/gist_id}","starred_url":"https://api.github.com/users/enchev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/enchev/subscriptions","organizations_url":"https://api.github.com/users/enchev/orgs","repos_url":"https://api.github.com/users/enchev/repos","events_url":"https://api.github.com/users/enchev/events{/privacy}","received_events_url":"https://api.github.com/users/enchev/received_events","type":"User","site_admin":false},"created_at":"2016-05-19T08:45:58Z","updated_at":"2016-05-19T08:45:58Z","body":"You can define the as expando:\r\n\r\n```\r\n<Label text=\"{{ Contact.phone2 }}\" />\r\n<Button text=\"sms\" phone=\"{{ Contact.phone2 }}\" tap=\"sendSMS\" />\r\n```\r\n```\r\nContacts.sendSMS = function(args) {\r\n   var phone = args.object.phone;\r\n}\r\n```\r\n\r\nAlso even if your original API is not flexible enough to use in the way you want you can always wrap it in a new view-model with desired structure. That's the beauty of MVVM.\r\n\r\n"}}