I'm working on trying to make an Angular directive that encapsulates the viewer.js functionality for the pdf.js project because I really like how their viewer looks, but I would like to be able to pass in variables from my own Angular bindings.
Now, there are two angular-pdf-like projects out there like Sayanee's project (https://github.com/sayanee/angularjs-pdf) which looks like it mostly provides the basic functionality at https://github.com/mozilla/pdf.js/blob/master/examples/text-selection/js/minimal.js and a Anrennmair's project at https://github.com/akrennmair/ng-pdfviewer
These pdf viewers really don't look very good, and I like how the pdf.js viewer shows the page after page view and lets you easily scroll through them. I don't need all the functionality of printing, bookmarks, attachments, saving, opening, etc so that should save at least some work, but my question is this:
How do I write this viewer as a directive? More specifically, in an answer to a previous question, the respondent said that the first GitHub project was poorly designed from an angular-way point of view. What's the proper way to do this? I would prefer to write it well the first time according to some best practices, but I've been unable to find anything clear about what those practices would be in this scope.