softshipper
softshipper

Reputation: 34061

What is the bind function

I am trying to learn angular2 with typescript and there is a code does I do not understand:

export var userServiceInjectables: Array<any> = [
  bind(UserService).toClass(UserService)
];

Could someone please explain me, what does code do?

Upvotes: 1

Views: 51

Answers (1)

G&#252;nter Z&#246;chbauer
G&#252;nter Z&#246;chbauer

Reputation: 657008

That's a very old way to define providers and is already removed in RC.6.

The current syntax is:

providers: [UserService]

or the long form

providers: [{provide: UserService, useClass: UserService}]

Upvotes: 2

Related Questions