
p.location-badge.
  exported from <a href="/angular2/di_errors.html">angular2/di_errors</a>
  defined in <a href="https://github.com/angular/angular/tree/master/modules/angular2/src/di/exceptions.js#L95">angular2/src/di/exceptions.js (line 95)</a>

:markdown
  Thrown when trying to retrieve an async <a href='../di/Binding-class.html'><code>Binding</code></a> using the sync API.
  
  ## Example
  
  ```javascript
  var injector = Injector.resolveAndCreate([
    bind(Number).toAsyncFactory(() => {
      return new Promise((resolve) => resolve(1 + 2));
    }),
    bind(String).toFactory((v) => { return "Value: " + v; }, [String])
  ]);
  
  injector.asyncGet(String).then((v) => expect(v).toBe('Value: 3'));
  expect(() => {
    injector.get(String);
  }).toThrowError(AsycBindingError);
  ```
  
  The above example throws because `String` depends on `Number` which is async. If any binding in the dependency
  graph is async then the graph can only be retrieved using the `asyncGet` API.
  
.l-main-section
  h2 Members
  .l-sub-section
    h3 constructor

    
    pre.prettyprint
      code.
        constructor(key)
    
    :markdown
      



