-1

I am working on an Angular 4 project which I build from the Angular CLI.

Next I want to install JSDOC

I did this following the instructions:

- npm install -g jsdoc
- npm install --save-dev jsdoc

So, now I have it installed.

My question is...what do I do next to generate the doc file?

It says in the documentation to run this command:

jsdoc yourJavaScriptFile.js

What does it mean with "yourJavascriptFile.js" ? I'm using Angular, which uses typescript ... and shouldn't it scan all my typescript files for comments and then generate the document?

The official documentation has nothing on this so I'm really confused.

Can anyone help of what to do?

matisetorm
  • 847
  • 8
  • 21

2 Answers2

1

You can't actually use JSDOC on Angular projects, since you're basically writing Typescript, however there are other alternatives to JSDOC, which support some of JSDOC formatted syntax, like typedoc and compodoc, the latter is mainly focused on Angular projects.

Osman Cea
  • 1,287
  • 7
  • 17
-1

I have tried to use it with angular 5 for generating pdf with typescript. Not exactly what asked but maybe help someone: First, npm install jspdf --save then install typings npm install @types/jspdf --save-dev then:

import * as jsPDF from 'jspdf';

 downloadPDF(){
    const doc = new jsPDF();
    doc.text("First name: " + this.userData.firstName, 10, 10);
    doc.save('UserData.pdf');
 }

In template:

<button type="button" pButton (click)="downloadPDF()" label="Download PDF"></button>
abstractME
  • 311
  • 3
  • 9