{"action":"created","issue":{"url":"https://api.github.com/repos/ufront/ufront-mvc/issues/9","labels_url":"https://api.github.com/repos/ufront/ufront-mvc/issues/9/labels{/name}","comments_url":"https://api.github.com/repos/ufront/ufront-mvc/issues/9/comments","events_url":"https://api.github.com/repos/ufront/ufront-mvc/issues/9/events","html_url":"https://github.com/ufront/ufront-mvc/issues/9","id":59003469,"number":9,"title":"How to use UFApi remoting?","user":{"login":"ProG4mr","id":2106619,"avatar_url":"https://avatars.githubusercontent.com/u/2106619?v=3","gravatar_id":"","url":"https://api.github.com/users/ProG4mr","html_url":"https://github.com/ProG4mr","followers_url":"https://api.github.com/users/ProG4mr/followers","following_url":"https://api.github.com/users/ProG4mr/following{/other_user}","gists_url":"https://api.github.com/users/ProG4mr/gists{/gist_id}","starred_url":"https://api.github.com/users/ProG4mr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ProG4mr/subscriptions","organizations_url":"https://api.github.com/users/ProG4mr/orgs","repos_url":"https://api.github.com/users/ProG4mr/repos","events_url":"https://api.github.com/users/ProG4mr/events{/privacy}","received_events_url":"https://api.github.com/users/ProG4mr/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":7,"created_at":"2015-02-26T01:37:34Z","updated_at":"2015-05-02T16:37:36Z","closed_at":null,"body":"Hey, i have a server UFApi class like so:\r\n\r\n```haxe\r\nclass SignupApi extends UFApi {\t\r\n\tpublic function test():String {\r\n\t\treturn \"returned!\";\r\n\t}\r\n}\r\n```\r\n\r\nand i have a JS client that tries to call the server method like so:\r\n```haxe\r\nstatic public function main() {\r\n    var sign:SignupApi = new SignupApi();\r\n    trace(\"returned? \" + sign.test());\r\n}\r\n```\r\n\r\nThe resulting trace is ```returned? null```, I'm probably missing something as the return should be asynchronous, how can i fix this client? Thanks!\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/ufront/ufront-mvc/issues/comments/98377097","html_url":"https://github.com/ufront/ufront-mvc/issues/9#issuecomment-98377097","issue_url":"https://api.github.com/repos/ufront/ufront-mvc/issues/9","id":98377097,"user":{"login":"kevinresol","id":1103788,"avatar_url":"https://avatars.githubusercontent.com/u/1103788?v=3","gravatar_id":"","url":"https://api.github.com/users/kevinresol","html_url":"https://github.com/kevinresol","followers_url":"https://api.github.com/users/kevinresol/followers","following_url":"https://api.github.com/users/kevinresol/following{/other_user}","gists_url":"https://api.github.com/users/kevinresol/gists{/gist_id}","starred_url":"https://api.github.com/users/kevinresol/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kevinresol/subscriptions","organizations_url":"https://api.github.com/users/kevinresol/orgs","repos_url":"https://api.github.com/users/kevinresol/repos","events_url":"https://api.github.com/users/kevinresol/events{/privacy}","received_events_url":"https://api.github.com/users/kevinresol/received_events","type":"User","site_admin":false},"created_at":"2015-05-02T16:37:36Z","updated_at":"2015-05-02T16:37:36Z","body":"Just figured a way, not sure if it is the best but I just write it down here:\r\n\r\n**Haxe**:\r\n```haxe\r\n// Client.hx\r\npublic static function main()\r\n{\r\n  var app = new ClientJsApplication(...);\r\n\r\n  // register a function in the global namespace so that the button in html can call it\r\n  untyped js.Browser.window.onButtonClick = function() \r\n  {\r\n    // call the async api. When the future is done, use pushstate to trigger a page \r\n    // change, which will be handled by the corresponding UFControllers\r\n    asyncApi.doSometing().handle(function(outcome) PushState.push(\"/some/url\"));\r\n  }\r\n}\r\n```\r\n\r\n**html page**:\r\n```html\r\n<!-- Put a button in page which, when clicked, will call the function defined above-->\r\n<button onclick=\"onButtonClick()\">Click me</button>\r\n```"}}