Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion aio/tools/transforms/angular-api-package/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ module.exports =
.processor(require('./processors/computeSearchTitle'))
.processor(require('./processors/simplifyMemberAnchors'))
.processor(require('./processors/computeStability'))
.processor(require('./processors/removeInjectableConstructors'))
.processor(require('./processors/removeInjectableAndInternalConstructors'))
.processor(require('./processors/processSpecialElements'))
.processor(require('./processors/collectPackageContentDocs'))
.processor(require('./processors/processPackages'))
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module.exports = function removeInjectableConstructors() {
module.exports = function removeInjectableAndInternalConstructors() {
return {
$runAfter: ['processing-docs', 'splitDescription'],
$runBefore: ['docs-processed'],
Expand All @@ -12,6 +12,9 @@ module.exports = function removeInjectableConstructors() {
doc.decorators.some(decorator => this.injectableDecorators.indexOf(decorator.name) !== -1)) {
delete doc.constructorDoc;
}
if(doc.constructorDoc && doc.constructorDoc.internal) {
delete doc.constructorDoc;
}
});
}
};
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const processorFactory = require('./removeInjectableConstructors');
const processorFactory = require('./removeInjectableAndInternalConstructors');
const testPackage = require('../../helpers/test-package');
const Dgeni = require('dgeni');

Expand All @@ -7,7 +7,7 @@ describe('removeInjectableConstructors processor', () => {
it('should be available on the injector', () => {
const dgeni = new Dgeni([testPackage('angular-api-package')]);
const injector = dgeni.configureInjector();
const processor = injector.get('removeInjectableConstructors');
const processor = injector.get('removeInjectableAndInternalConstructors');
expect(processor.$process).toBeDefined();
expect(processor.$runAfter).toEqual(['processing-docs', 'splitDescription']);
expect(processor.$runBefore).toEqual(['docs-processed']);
Expand All @@ -23,6 +23,7 @@ describe('removeInjectableConstructors processor', () => {
{ constructorDoc: {}, decorators: [{ name: 'Directive' }] },
{ constructorDoc: {}, decorators: [{ name: 'Pipe' }] },
{ constructorDoc: {}, decorators: [{ name: 'Other' }, { name: 'Injectable' }] },

{ constructorDoc: {}, decorators: [{ name: 'Other' }] },

{ constructorDoc: { shortDescription: 'Blah' } },
Expand All @@ -33,6 +34,8 @@ describe('removeInjectableConstructors processor', () => {
{ constructorDoc: { shortDescription: 'Blah' }, decorators: [{ name: 'Pipe' }] },
{ constructorDoc: { shortDescription: 'Blah' }, decorators: [{ name: 'Other' }, { name: 'Injectable' }] },
{ constructorDoc: { shortDescription: 'Blah' }, decorators: [{ name: 'Other' }] },

{ constructorDoc: { internal: true } },
];

processor.$process(docs);
Expand All @@ -54,5 +57,7 @@ describe('removeInjectableConstructors processor', () => {
expect(docs[13].constructorDoc).toBeDefined();
expect(docs[14].constructorDoc).toBeDefined();
expect(docs[15].constructorDoc).toBeDefined();

expect(docs[16].constructorDoc).toBeUndefined();
});
});