1

I have a master/detail view app, when users go back from detail to master view, I'd like to take a screenshot of the detail view using html2canvas The problem is that html2canvas provides only async methods for screen capturing, so I need to hold the route change until the capture is done, then resume, how can I do this?

Jiaji
  • 175
  • 11
  • Does `html2canvas(document.body).then(function(canvas) { /* whatever you do with the canvas */; $location.path('/next-route'); });` not accomplish that? – Bennett Adams Feb 21 '16 at 15:26
  • can prevent route change if needed within `$routeChangeStart` event and use flag to make sure you have what you need before proceeding – charlietfl Feb 21 '16 at 17:10
  • I may have a solution, but depends on your current implementation. Can you post your code for controller and html? – LJ.Wizard Feb 21 '16 at 19:10
  • @BennettAdams If the user goes back to main view via the browser's Back button, then there's nowhere to put this code, I think I have to listen to route change events, hold the change, take capture, then resume. – Jiaji Feb 22 '16 at 05:48

0 Answers0