Hi,
I'm trying to build a configurable provider with ng-forward. I'm using angular2/http as reference, where the Http instance is injected based on RequestOptions. As you know, injected Http instance is configured by providing RequestOptions implementation using provide function, which is then injected in useFactory of Http.
In this plunkr i created MyClass to be injected in AppCtrl which should be pointed to MyClassFoo extends MyClass instance. But instead of getting myClass.something to be foo, it still points to default, in which case, the original MyClass instance.
Meanwhile in this plunkr i implemented above scenario in angular 2 and it works as expected.
If i use string token or OpaqueToken, it also works as expected.
Is there something i missed?
Edit: In provider.spec.ts, I noticed you guys missing useClass test where the token is the class itself and the value of useClass points to different class. Maybe my scenario above has not been covered?
Hi, I'm trying to build a configurable provider with ng-forward. I'm using
angular2/http
as reference, where theHttp
instance is injected based onRequestOptions
. As you know, injectedHttp
instance is configured by providingRequestOptions
implementation usingprovide
function, which is then injected in useFactory ofHttp
.In this plunkr i created
MyClass
to be injected inAppCtrl
which should be pointed toMyClassFoo extends MyClass
instance. But instead of gettingmyClass.something
to befoo
, it still points todefault
, in which case, the originalMyClass
instance.Meanwhile in this plunkr i implemented above scenario in angular 2 and it works as expected.
If i use string token or
OpaqueToken
, it also works as expected.Is there something i missed?
Edit: In
provider.spec.ts
, I noticed you guys missinguseClass
test where the token is the class itself and the value ofuseClass
points to different class. Maybe my scenario above has not been covered?