Angular4: Component.name doesn't work on production

后端 未结 4 1703
有刺的猬
有刺的猬 2021-01-03 10:42

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

4条回答
  •  醉酒成梦
    2021-01-03 11:30

    Yes, this is normal since angular-cli/webpack and other tools are changing the class name by minifying the JavaScript code. So after minification in production build, you'll always only see one letter or something similar.

    Don't use this name in your logic because it will break in production.

提交回复
热议问题