Angular2's provide() function deprecated in RC4 and later, what should be used instead?
问题 I just upgraded from Angular2 RC1 to RC4. Before I used: provide(LocationStrategy, {useClass: HashLocationStrategy}) However, after upgraded to RC4, the provide shows as deprecated. I did not find any documentation on this. Does anyone have an idea about what happened? 回答1: As was pointed out in the comments above, you should now just use an object with provide and useClass properties, such as in the following: bootstrap(App, [ CookieService, AuthService, WindowService, COMMON_DIRECTIVES,