Skip to content
This repository has been archived by the owner on Feb 22, 2018. It is now read-only.

Usage of "await" w/o an assignment causes the error in the runtime #1701

Open
antonmoiseev opened this issue Mar 30, 2015 · 0 comments
Open

Comments

@antonmoiseev
Copy link

If I use await and don't save the result of async operation in a variable, AngularDart throws an error in the runtime.

Example:

@Component(...)
class MyComponent {
  MyService _myService;

  MyComponent(this._myService);

    method() async {
      await _myService.doAsyncOperation();
    }
}

This throws following error: Type 'MyComponent' not found in generated typeFactory maps. Is the type's constructor injectable and annotated for injection?

When I save the result in a variable, the code works fine:

final _ = await _myService.doAsyncOperation();

AngularDart revision: 011d65f00d7a7d5f825b4337cf594baf20e6625f.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

No branches or pull requests

1 participant