p.location-badge.
exported from angular2/annotations
defined in angular2/src/core/annotations/decorators.ts (line 243)
:markdown
Attribute
factory for creating annotations, decorators or DSL.
## Example as TypeScript Decorator
```
import {Attribute, Component, View} from "angular2/angular2";
@Component({...})
@View({...})
class MyComponent {
constructor(@Attribute('title') title: string) {
...
}
}
```
## Example as ES5 DSL
```
var MyComponent = ng
.Component({...})
.View({...})
.Class({
constructor: [new ng.Attribute('title'), function(title) {
...
}]
})
```
## Example as ES5 annotation
```
var MyComponent = function(title) {
...
};
MyComponent.annotations = [
new ng.Component({...})
new ng.View({...})
]
MyComponent.parameters = [
[new ng.Attribute('title')]
]
```