Questions tagged [reflect-metadata]

83 questions
0
votes
3 answers

How bundle polyfills and external library with Rollup JS?

It's my first application with Angular 2. We run aot and rollup in order to generate a bundle. But we must always add polyfills (shim, reflect-metadata and zone.js) to the index.html with script HTML element. Is it possible to add this polyfills to…
lecogiteur
  • 307
  • 1
  • 7
  • 16
0
votes
1 answer

Typescript Reflect.getMetadata('design:type'..) returns Object instead of Date if the Angular 2 Stack is used

The following code Sample is working as expected and prints out "[Function: Date]" import 'reflect-metadata' function logType(target : any, key : string) { var t = Reflect.getMetadata("design:type", target, key); console.log(`${key} type:…
J.R.
  • 1
  • 1
  • 1
  • 2
0
votes
2 answers

Use Angular 2 without Reflect.js and zone.js in Browser

I am trying to use Angular within an existing typescript project, where I am using browserify to bundle the actual app. Now, i have basically just rebuilt the app from the setup tutorial and managed to get it all…
nozzleman
  • 9,529
  • 4
  • 37
  • 58
0
votes
1 answer

reflect-metadata Reflect.getMetadata() method doesn't return metadata on the prototype chain of provided object

I'm using reflect-metadata 0.1.2. I have a parent class as "MyCustom". export class MyCustom {} My "Home" component class extend this "MyCustom" class. @Component({ selector: 'home', templateUrl: './app/components/home/home.html', …
0
votes
1 answer

Function instead of interface name when using Reflect

I've a problem with using reflect in field decorators. I've created a decorator with below signature: export function Inject() { return function (clazz, name) { ....... let typeName: string = Reflect.getOwnMetadata("design:type",…
Pooya
  • 4,385
  • 6
  • 45
  • 73
0
votes
1 answer

Resolving "reflect-metadata shim is required when using class decorators" in Modular Angular 2 Component Project

I am trying to create a typescript package that includes Angular 2 decorators. This package's intent is to export a NgModule to be imported into a larger project after it is installed by npm. When I attempt to run tests through jasmine I get the…
Don
  • 61
  • 5
0
votes
1 answer

Can we iterate over all EventEmitter decorated with @Output() in Angular 2

What I want to achieve is for a given component instance I want to iterate over all the EventEmitter decorated with @Output. For e.g. my-component @Component({ moduleId: module.id, selector: "my-component", template: "

My…

Madhu Ranjan
  • 17,334
  • 7
  • 60
  • 69
-1
votes
1 answer

TypeScript metadata in module issue

I have a framework that uses metadata with decorator in TypeScript so I know it is working. However, today I just found a bizarre basic case that I can't figure out why. It is reproducible in TS@2.1.5, @2.1.6, and @2.2.0-dev.20170214 The issue can…
unional
  • 14,651
  • 5
  • 32
  • 56
1 2 3 4 5
6