Skip to content

Commit

Permalink
fix(deps): wrong generated links of module declarations
Browse files Browse the repository at this point in the history
fix #372
  • Loading branch information
vogloblinsky committed Nov 14, 2017
1 parent 4774f9e commit ab1af5b
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions src/app/engines/dependencies.engine.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,40 @@ export class DependenciesEngine {
return _m;
}

private updateModulesDeclarationsExportsTypes() {
let _m = this.modules,
i = 0,
len = this.modules.length;

let mergeTypes = (entry) => {
let directive = this.findInCompodocDependencies(entry.name, this.directives);
if (typeof directive.data !== 'undefined') {
entry.type = 'directive';
}
let component = this.findInCompodocDependencies(entry.name, this.components);
if (typeof component.data !== 'undefined') {
entry.type = 'component';
}
let pipe = this.findInCompodocDependencies(entry.name, this.pipes);
if (typeof pipe.data !== 'undefined') {
entry.type = 'pipe';
}
}

this.modules.forEach((module) => {
module.declarations.forEach((declaration) => {
mergeTypes(declaration);
});
module.exports.forEach((expt) => {
mergeTypes(expt);
});
module.entryComponents.forEach((ent) => {
mergeTypes(ent);
});
})

}

public init(data: ParsedData) {
traverse(data).forEach(function (node) {
if (node) {
Expand All @@ -88,6 +122,7 @@ export class DependenciesEngine {
this.classes = _.sortBy(this.rawData.classes, ['name']);
this.miscellaneous = this.rawData.miscellaneous;
this.prepareMiscellaneous();
this.updateModulesDeclarationsExportsTypes();
this.routes = this.rawData.routesTree;
}

Expand Down

0 comments on commit ab1af5b

Please sign in to comment.