hannahhoward / a1atscript

The Angular 2 Polyfill
MIT License
101 stars 7 forks source link

Need to update @Directive so it acts like the ng2 annotation #20

Open timkindberg opened 9 years ago

timkindberg commented 9 years ago

See: https://angular.io/docs/js/latest/api/annotations/DirectiveAnnotation-class.html

@Directive is basically a @Component without a view. So its a directive that alters the behavior of an element. So we should be able to use it just like @Component, like this;

@Directive({
  selector: '[dependency]',
  properties: ['id']
})
class Dependency { }

I know right now @Directive is an ng1 decorator for basically doing ng1 style directive declaration. But I think a1atscript should focus on being a pure ng2 polyfill (my two cents).