What exactly does a selector do in angular 2?
<p>What does the selector do in this case?</p>

<pre><code>import { Component } from '@angular/core';
import { HighlightDirective } from './highlight.directive';

@Component({
  selector: 'my-app',
  templateUrl: 'app/app.component.html',
  directives: [HighlightDirective]
})
export class AppComponent { }
</code></pre>

<p>And what does it do in this case?</p>

<pre><code>@Directive({
  selector: '[myHighlight]',
  host: {
    '(mouseenter)': 'onMouseEnter()',
    '(mouseleave)': 'onMouseLeave()'
  }
})
</code></pre>