Skip to content

Commit

Permalink
fix(deps): Generic array types support
Browse files Browse the repository at this point in the history
fix #552
  • Loading branch information
vogloblinsky committed May 8, 2018
1 parent 3464b0c commit 0ad79de
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
3 changes: 3 additions & 0 deletions src/app/compiler/deps/helpers/class-helper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -675,6 +675,9 @@ export class ClassHelper {
}
} else if (node.elementType) {
_return = kindToType(node.elementType.kind) + kindToType(node.kind);
if (node.elementType.typeName) {
_return = this.visitTypeName(node.elementType.typeName) + kindToType(node.kind);
}
} else if (node.types && ts.isUnionTypeNode(node)) {
_return = '';
let i = 0;
Expand Down
5 changes: 5 additions & 0 deletions test/src/cli/cli-generation-big-app.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -649,4 +649,9 @@ describe('CLI simple generation - big app', () => {
expect(file).to.contain('<code>LinearDomain: <code>[Number, Number]</code>');
expect(file).to.contain('<code>LinearTodo: <code><a href="../classes/Todo.html" target="_self" >[Todo, Todo]</a></code>');
});

it('should support Generic array types', () => {
let file = read(distFolder + '/components/AppComponent.html');
expect(file).to.contain('<a href="../classes/Todo.html" target="_self">Observable&lt;Todo[]&gt;</a>');
});
});
4 changes: 3 additions & 1 deletion test/src/todomvc-ng2/src/app/app.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,7 @@ import { Component } from '@angular/core';
styleUrls: ['./app.component.css']
})
export class AppComponent {

public getOrganizations(): Observable<Todo[]> {
console.log('yo');
}
}

0 comments on commit 0ad79de

Please sign in to comment.