fix(ivy): inherited host listeners called twice (#29170)

Fixes host listeners being inherited twice when going through `setClassMetadata`.

This PR resolves FW-1142.

PR Close #29170
This commit is contained in:
Kristiyan Kostadinov
2019-03-08 18:21:15 +01:00
committed by Kara Erickson
parent b6f6b1178f
commit a746b5b1ea
4 changed files with 59 additions and 4 deletions

View File

@ -214,7 +214,7 @@ export class ReflectionCapabilities implements PlatformReflectionCapabilities {
if (!isType(typeOrFunc)) {
return {};
}
return this._ownPropMetadata(typeOrFunc, Object) || {};
return this._ownPropMetadata(typeOrFunc, getParentCtor(typeOrFunc)) || {};
}
hasLifecycleHook(type: any, lcProperty: string): boolean {

View File

@ -137,7 +137,7 @@ export function extendsDirectlyFromObject(type: Type<any>): boolean {
* Extract the `R3DirectiveMetadata` for a particular directive (either a `Directive` or a
* `Component`).
*/
function directiveMetadata(type: Type<any>, metadata: Directive): R3DirectiveMetadataFacade {
export function directiveMetadata(type: Type<any>, metadata: Directive): R3DirectiveMetadataFacade {
// Reflect inputs and outputs.
const propMetadata = getReflect().ownPropMetadata(type);