Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Empty value on production build #67

Open
webmatrixxxl opened this issue Apr 7, 2017 · 0 comments
Open

Empty value on production build #67

webmatrixxxl opened this issue Apr 7, 2017 · 0 comments

Comments

@webmatrixxxl
Copy link

webmatrixxxl commented Apr 7, 2017

Hello. I'm trying to get selector value and use it in my component class, but on production annotations[0].selector is empty.

import { Directive, ElementRef, AfterContentInit } from '@angular/core';

@Directive({
  selector: '[appLinkedCheckbox]'
})
export class LinkedCheckboxDirective implements AfterContentInit {
  private el: HTMLElement;

  constructor(el: ElementRef) {
    this.el = el.nativeElement;
  }

  public ngAfterContentInit() {
    let annotations = Reflect.getMetadata('annotations', this.constructor);
    let selector    = annotations[0].selector;  // This value is empty on production build
  }
}

@angular/cli: 1.0.0-rc.0
node: 7.7.4
os: darwin x64
@angular/common: 2.4.10
@angular/compiler: 2.4.10
@angular/core: 2.4.10
@angular/forms: 2.4.10
@angular/http: 2.4.10
@angular/platform-browser: 2.4.10
@angular/platform-browser-dynamic: 2.4.10
@angular/platform-server: 2.4.10
@angular/router: 3.4.10
@angular/compiler-cli: 2.4.10
@angular/cli: 1.0.0-rc.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant