nottinhill nottinhill - 1 year ago 114
TypeScript Question

Convert angular2 component name / "this" to String

In an Angular2 Component, when doing:

console.log (this);

you get as expected the whole object with all members, e.g.

"ComponentName {member1, member2, member_n}"

Now I want to only log the ComponentName. How to achieve?

Answer Source

Really interesting question, this is what you are looking for:

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download