Currently, OpaqueToken is not implemented correctly because it does not generate unique tokens. The DI system of ng1 works with strings in this library is using the toString() method of the OpaqueToken object as identifier which is not unique.
new OpaqueToken('foo').toString() === new OpaqueToken('foo').toString()
// true
In order to fix this, it should keep track of a unique index (static property) which should be attached in the toString() method.
Currently,
OpaqueToken
is not implemented correctly because it does not generate unique tokens. The DI system of ng1 works with strings in this library is using thetoString()
method of theOpaqueToken
object as identifier which is not unique.In order to fix this, it should keep track of a unique index (static property) which should be attached in the toString() method.