ng-pdfviewer icon indicating copy to clipboard operation
ng-pdfviewer copied to clipboard

Setting up the controller without the array

Open wmbutler opened this issue 10 years ago • 1 comments

Is there a way to set this up without the array in the controller?

You have:

.controller('CaseCtrl', ['$scope','PDFViewerService', function ($scope, pdf ) {

I'd prefer to use:

.controller('CaseCtrl', function ($scope, pdf ) {

Mainly because I'm injecting a bunch of other stuff and don't know all the declarations for them on the array side of things.

wmbutler avatar Apr 29 '14 01:04 wmbutler

Substitute pdf with PDFViewerService.

The array is a method used to inject proper variable names when minifying/uglifying.

I use grunt and ng-min to do this, so handling it manually isn't necessary for me:

.controller('CaseCtrl', function ($scope, PDFViewerService ) { ... })

Then, wherever the example showed pdf. use PDFViewerService. instead. Or simply rename it

var pdf = PDFViewerService;

joseym avatar May 12 '14 19:05 joseym