feat(metadata): emit all methods
This is needed to detect lifecycle hooks.
This commit is contained in:
parent
3229bf1665
commit
29700aa188
|
@ -131,7 +131,6 @@ export class MetadataCollector {
|
||||||
hasParameterData = true;
|
hasParameterData = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (methodDecorators || hasDecoratorData || hasParameterData) {
|
|
||||||
const data: MethodMetadata = {__symbolic: isConstructor ? "constructor" : "method"};
|
const data: MethodMetadata = {__symbolic: isConstructor ? "constructor" : "method"};
|
||||||
const name = isConstructor ? "__ctor__" : evaluator.nameOf(member.name);
|
const name = isConstructor ? "__ctor__" : evaluator.nameOf(member.name);
|
||||||
if (methodDecorators) {
|
if (methodDecorators) {
|
||||||
|
@ -144,7 +143,6 @@ export class MetadataCollector {
|
||||||
(<ConstructorMetadata>data).parameters = parametersData;
|
(<ConstructorMetadata>data).parameters = parametersData;
|
||||||
}
|
}
|
||||||
recordMember(name, data);
|
recordMember(name, data);
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
case ts.SyntaxKind.PropertyDeclaration:
|
case ts.SyntaxKind.PropertyDeclaration:
|
||||||
case ts.SyntaxKind.GetAccessor:
|
case ts.SyntaxKind.GetAccessor:
|
||||||
|
|
|
@ -146,7 +146,10 @@ describe('Collector', () => {
|
||||||
parameters:
|
parameters:
|
||||||
[{__symbolic: 'reference', name: undefined, module: './hero.service'}]
|
[{__symbolic: 'reference', name: undefined, module: './hero.service'}]
|
||||||
}
|
}
|
||||||
]
|
],
|
||||||
|
onSelect: [{__symbolic: 'method'}],
|
||||||
|
ngOnInit: [{__symbolic: 'method'}],
|
||||||
|
getHeroes: [{__symbolic: 'method'}]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue