Skip to content

Discussion: Rename DI Bindings into Providers #4416

@vsavkin

Description

@vsavkin

Using the same word "binding" for two core ideas of the framework causes some confusion.

Proposal: Rename Binding into Provider, and bindings into providers.

@Component({
  providers: [
    // the constructor version  
    new Provider(Http, {toClass: CustomHttp}),

    // using builder
    provide(Http).viaFactory(customFactory),

    // using a different type of builder
    provide(Http, {value: customFactory})
  ]
})

Pros:

  • Similar to Angular 1
  • Binding means only data-bindings

Cons:

  • Different from other DI systems, which mostly use the word binding

@IgorMinar @mhevery

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions