dgeni-packages icon indicating copy to clipboard operation
dgeni-packages copied to clipboard

Can't figure out to document angular with typescript

Open caseyhoward opened this issue 9 years ago • 2 comments

I created a fork of a project that works for generating angular documentation. However, I need to be able to use typescript. I tried modifying it to make typescript work. It acts like it works (no errors in the console when building) but the documentation is blank. The repo is here: https://github.com/caseyhoward/angular-dgeni-seed

Help would greatly be appreciated.

caseyhoward avatar Jun 17 '16 20:06 caseyhoward

I can't figure it out either. I really wish there was an official typescript example. I've been struggling with this on and off for weeks

tommck avatar Mar 20 '17 13:03 tommck

I got it working by adding a factory like this:

.factory('tsngFileReader', function (jsdocFileReader) {
  return {
    name: 'tsngFileReader',
    defaultPattern: /\.ts$/,
    getDocs: jsdocFileReader.getDocs
  };
})

And then adding the file reader:

.config(function (readFilesProcessor, writeFilesProcessor, log, tsngFileReader) {
  // scrape .ts files for ngdoc comments
  readFilesProcessor.fileReaders.push(tsngFileReader);
})

chriscasola avatar Jan 25 '18 17:01 chriscasola