Isaiah Taguibao
Isaiah Taguibao

Reputation: 33

How to use pdfMake in AngularJS?

I am using pdfMake to generate pdf in AngularJS. I have downloaded the bower package.

Do I need to inject it to my modules and controllers before I can use it?

Upvotes: 3

Views: 6115

Answers (1)

Sajeetharan
Sajeetharan

Reputation: 222542

You need to add the references and you can use it as follows,

$scope.downloadPdf = function() {
    pdfMake.createPdf(docDefinition).download();
};

Find this repository which has a demo with pdfMake and angularjs

Upvotes: 3

Related Questions