So I've been facing this weird issue but I'm not sure if it's a bug or it's me missing something here.
So I have a component called TestComponent
and in the AppComponent I have a button when I click on it I get the name of the TestComponent
by doing this TestComponent.name
.
AppComponent:
import { TestComponent } from './test/test.component';
import { Component } from '@angular/core';
@Component({
selector: 'app-root',
template: '<button (click)="showName()">Show</button>'
})
export class AppComponent {
showName(){
console.log('component name: "' + TestComponent.name + '"');
}
}
As you can see by clicking on the button I want to get the TestComponent's name which basically "TestComponent"
The problem is that this works well on development mode and if I call ng build
too works fine and this is what I get in the console:
And when I call ng build --prod
, to compress files and reduce their size, I get this result:
Is this normal ?!