How are decorators (annotations) compiled in Typescript?
<p>In Angular 2, I can create a component, like this:</p>

<pre><code>import {Component, Template} from 'angular2/angular2'

@Component({
  selector: 'my-component'
})
@View({
  inline: "&lt;div&gt;Hello my name is {{name}}&lt;/div&gt;"
})
export class MyComponent {
  constructor() {
    this.name = 'Max'
  }
  sayMyName() {
    console.log('My name is', this.name)
  }
}
</code></pre>

<p>(source: <a href="http://blog.ionic.io/angular-2-series-components/">http://blog.ionic.io/angular-2-series-components/</a>)</p>

<p>This is then compiled into regular ES5.</p>

<p>My question is in 2 parts:</p>

<ol>
<li>These decorators are specific to Angular. How are they defined?</li>
<li>How do I define my own decorators?</li>
</ol>