reflect-metadata Questions
3
Solved
import "reflect-metadata"
function validate(target: any) {
let paramtypes = Reflect.getMetadata("design:paramtypes", target);
console.log(paramtypes); // undefined
}
@valida...
Zebapda asked 29/7, 2021 at 5:28
3
Solved
I have a React / Mobex application written in TypeScript, built by Webpack 1. After updating TypeScript version from 2.3.4 to 2.4.2 i get an error
ERROR in C:\myproject\tsconfig.json
error TS2688:...
Control asked 22/3, 2018 at 17:56
2
Solved
what are reflect-metadata and its purpose?
What is syntax and purpose of using reflect-metadata?
Can some one provide the example for better understanding of the same?
How can be the reflect met...
Seminarian asked 17/7, 2017 at 4:13
1
I'm using reflect-metadata with typescript. I composed my own property decorator and it's called Field. How to get list of fields/properties, which are decorated by Field, of any type. For example:...
Silesia asked 19/6, 2017 at 10:16
2
Given the following entity definition:
@Entity()
export class User extends BaseEntity {
@Column({ nullable: true })
name!: string | null;
@Column()
age!: number;
}
The following error appear...
Scientist asked 14/10, 2020 at 9:54
2
When function return type is Promise<number> , how can i get it with reflection?
If i just do
Reflect.getMetadata("design:returntype", target, key)
it's return just Promise, so there is a...
Revivify asked 7/2, 2019 at 2:56
2
I tried to apply the @Reflect.metadata decorator to a TypeScript class, following the example on lines 82-84 of reflect-metadata.d.ts:
/// <reference path="node_modules/reflect-metadata/reflect...
Nehemiah asked 28/12, 2015 at 20:27
1
Solved
I'm using a property decorator Field which pushes its' key to a fields Reflect metadata property:
export function Field(): PropertyDecorator {
return (target, key) => {
const fields = Reflect....
Hilleary asked 12/3, 2019 at 8:36
1
Solved
I'm currently learning TypeScript with Node. Reading about TypeORM, I saw that the reflect-metadata package is needed for TypeORM to work. What is the reason for this package being needed?
Ute asked 2/4, 2018 at 20:59
1
Solved
Without decorators the metadata is lost - but why?
const Baz = () : ClassDecorator => {
return target => {}
}
class Bar {}
@Baz()
class Foo {
constructor(bar: Bar) {}
}
console.log(Reflect...
Chrissa asked 31/1, 2018 at 16:32
1
Solved
As said in the title: the reflect-metadata API provides a getMetadata method and a getOwnMetadata - what's the difference here? Same goes for hasOwnMetadata, etc.
Masque asked 29/1, 2018 at 20:22
1
Solved
I'm having two decorators. A class decorator and a method decorator.
The class decorator defines metadata which I want to access in the method decorator.
ClassDecorator:
function ClassDecorator(...
Paraglider asked 19/1, 2018 at 13:53
3
After upgrading my pre-existing project to Angular 4 and Angular/CLI 1.0 I'm getting this error:
core.es5.js:354 Uncaught reflect-metadata shim is required when using class decorators
I've compa...
Kor asked 10/4, 2017 at 21:57
1
Solved
If I use a decorator in my class the decorator is evaluated when importing the class. Here is the small example:
@NgModule({ ... })
export class BModule { ... }
Transpiled as:
var BModule = (fu...
Briannebriano asked 24/7, 2017 at 7:27
1
© 2022 - 2024 — McMap. All rights reserved.