Skip to content

Commit

Permalink
fix(app): setters arguments correctly documented
Browse files Browse the repository at this point in the history
fix #1062
  • Loading branch information
vogloblinsky committed Jul 2, 2021
1 parent 2ff7c21 commit 8190df5
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 6 deletions.
7 changes: 1 addition & 6 deletions src/app/compiler/angular/deps/helpers/class-helper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -271,12 +271,7 @@ export class ClassHelper {
type: 'void',
deprecated: false,
deprecationMessage: '',
args: nodeAccessor.parameters.map(param => {
return {
name: param.name.text,
type: param.type ? kindToType(param.type.kind) : ''
};
}),
args: nodeAccessor.parameters.map(param => this.visitArgument(param)),
returnType: nodeAccessor.type ? this.visitType(nodeAccessor.type) : 'void',
line: this.getPosition(nodeAccessor, sourceFile).line + 1
};
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { Component, Input, Output, HostBinding, HostListener } from '@angular/core';
import { Todo } from '../models/todo.model';

import { DumbParentComponent } from './dumb-parent-component';

Expand All @@ -17,6 +18,8 @@ export class DumbComponent extends DumbParentComponent {
*/
emptyProperty = '';

_todo;

/**
* @example
* component input
Expand Down Expand Up @@ -62,4 +65,11 @@ export class DumbComponent extends DumbParentComponent {
emptyMethod(emptyParam: string) {
return emptyParam;
}

/**
* @param {VisibleLayer} value
*/
set visibleTodos(value: Todo) {
this._todo = value;
}
}
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 @@ -429,6 +429,11 @@ describe('CLI simple generation - big app', () => {
expect(file).to.contain('Setter of _fullName');

expect(file).to.contain('Inputs');

file = read(distFolder + '/components/DumbComponent.html');
expect(file).to.contain(
'<code>visibleTodos(value: <a href="../classes/Todo.html" target="_self">Todo</a>)</code>'
);
});

it('should support QualifiedName for type', () => {
Expand Down

0 comments on commit 8190df5

Please sign in to comment.