OpaqueToken

OpaqueToken

Stable Class

Class Overview

class OpaqueToken {
  constructor(_desc: string)
  
  
  toString() : string
}

Class Description

Creates a token that can be used in a DI Provider.

Example (live demo)

var t = new OpaqueToken("value");

var injector = Injector.resolveAndCreate([
  {provide: t, useValue: "bindingValue"}
]);

expect(injector.get(t)).toEqual("bin