Skip to content

Commit

Permalink
Merge pull request #114 from nbeach/fix-angular-14
Browse files Browse the repository at this point in the history
Fixed input annotation detection for angular 14
  • Loading branch information
nbeach committed May 27, 2023
2 parents 26bf652 + bc61b4d commit f5a0298
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/mock-component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ function propertiesDecoratedWith(decorator: any, propertyMetadata: any): string[
}

function instanceExistsIn<T>(object: Type<T>, list: any[]): boolean {
return list.some(dec => dec instanceof object)
return list.some(dec => dec instanceof object || (object as any).annotationCls === dec.type)
}

export type MockSetup = (mock: any) => void
Expand Down
2 changes: 1 addition & 1 deletion src/reflection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@ export function getAnnotation(object: Type<any>, annotationType: any): any | und
}

export function propertyMetadata(object: Type<any>): any {
return (object as any).__prop__metadata__ || Reflect.getMetadata("propMetadata", object) || {}
return (object as any).propDecorators || (object as any).__prop__metadata__ || Reflect.getMetadata("propMetadata", object) || {}
}

0 comments on commit f5a0298

Please sign in to comment.