jokade / angulate2

Scala.js bindings for Angular
MIT License
87 stars 15 forks source link

Adds @Input() similar to typescript API #21

Closed gregghz closed 8 years ago

gregghz commented 8 years ago

This allows you to write @Input() in much the same way as the typescript API:

@Component(
  ...
  inputs = js.Array("the-hero:hero")
)
class TheComponent {
  var hero: js.UndefOr[Hero] = js.undefined
}

can now be written as:

@Component(
  ...
)
class TheComponent {
  @Input("the-hero")
  var hero: js.UndefOr[Hero] = js.undefined
}

@Input() works with no parameter as well and if you explicitly specify the inputs parameter it will merge the annotation inputs with the parameter passed in.

jokade commented 8 years ago

LGTM, thanks for your effort!