{"action":"created","issue":{"url":"https://api.github.com/repos/niklasvh/html2canvas/issues/743","repository_url":"https://api.github.com/repos/niklasvh/html2canvas","labels_url":"https://api.github.com/repos/niklasvh/html2canvas/issues/743/labels{/name}","comments_url":"https://api.github.com/repos/niklasvh/html2canvas/issues/743/comments","events_url":"https://api.github.com/repos/niklasvh/html2canvas/issues/743/events","html_url":"https://github.com/niklasvh/html2canvas/issues/743","id":120097145,"number":743,"title":"help on using promise to return dataURL","user":{"login":"kucheech","id":13144295,"avatar_url":"https://avatars.githubusercontent.com/u/13144295?v=3","gravatar_id":"","url":"https://api.github.com/users/kucheech","html_url":"https://github.com/kucheech","followers_url":"https://api.github.com/users/kucheech/followers","following_url":"https://api.github.com/users/kucheech/following{/other_user}","gists_url":"https://api.github.com/users/kucheech/gists{/gist_id}","starred_url":"https://api.github.com/users/kucheech/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kucheech/subscriptions","organizations_url":"https://api.github.com/users/kucheech/orgs","repos_url":"https://api.github.com/users/kucheech/repos","events_url":"https://api.github.com/users/kucheech/events{/privacy}","received_events_url":"https://api.github.com/users/kucheech/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2015-12-03T05:24:44Z","updated_at":"2016-11-02T08:02:20Z","closed_at":null,"body":"[Question posted on Stackoverflow](http://stackoverflow.com/questions/34058419/need-help-on-the-use-of-promise-with-html2canvas)\n\nI am quite new to Promise and was trying to use it with html2canvas. Essentially, I need to extract the dataURL from the canvas and return it. Please help to correct my code. Thanks in advance!\n\n```\ngetImage: function() {\n\nvar p = new Promise(\n    function(resolve, reject) {\n\n        html2canvas(document.body).then(function(canvas) {\n            var image = canvas.toDataURL(\"image/png\");\n            resolve(image);\n        });\n});\n\np.then(function(image){ return image;})\n.catch(function(err){ console.log(err)});\n```\n"},"comment":{"url":"https://api.github.com/repos/niklasvh/html2canvas/issues/comments/257796819","html_url":"https://github.com/niklasvh/html2canvas/issues/743#issuecomment-257796819","issue_url":"https://api.github.com/repos/niklasvh/html2canvas/issues/743","id":257796819,"user":{"login":"atefBB","id":10966925,"avatar_url":"https://avatars.githubusercontent.com/u/10966925?v=3","gravatar_id":"","url":"https://api.github.com/users/atefBB","html_url":"https://github.com/atefBB","followers_url":"https://api.github.com/users/atefBB/followers","following_url":"https://api.github.com/users/atefBB/following{/other_user}","gists_url":"https://api.github.com/users/atefBB/gists{/gist_id}","starred_url":"https://api.github.com/users/atefBB/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/atefBB/subscriptions","organizations_url":"https://api.github.com/users/atefBB/orgs","repos_url":"https://api.github.com/users/atefBB/repos","events_url":"https://api.github.com/users/atefBB/events{/privacy}","received_events_url":"https://api.github.com/users/atefBB/received_events","type":"User","site_admin":false},"created_at":"2016-11-02T08:02:20Z","updated_at":"2016-11-02T08:02:20Z","body":"Thanks @MaxiSantos +1.\r\nI'll test It !"}}
{"actor":{"display_login":"atefBB"}}