Accessing `selector` from within an Angular 2 component
<p>I'm trying to figure out how I can access the <code>selector</code> that we pass into the  <code>@Component</code> decorator.</p>
<p>For example</p>
<pre class="lang-js prettyprint-override"><code>@Component({
  selector: 'my-component'
})
class MyComponent {
  constructor() {
     // I was hoping for something like the following but it doesn't exist
     this.component.selector // my-component
  }
}
</code></pre>
<p>Ultimately, I would like to use this to create a directive that automatically adds an attribute <code>data-tag-name=&quot;{this.component.selector}&quot;</code> so that I can use Selenium queries to reliably find my angular elements by their selector.</p>
<p>I am not using protractor</p>