Angular4: Component.name doesn't work on production

后端 未结 4 1681
有刺的猬
有刺的猬 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:37

    The best way I found was to use a library that renames the class at compile time, works similar to the C # nameof. nameof(); Result: "MyInterface"

    https://github.com/dsherret/ts-nameof

提交回复
热议问题