Take the 2-minute tour ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.

I have a podo class CarStorage for angular to inject.

class CarStorage {
  int _carIdCounter = 0;
  ...

I wire it in using type:

module
    ..type(CarForm)
    ..type(CarItemsList)
    ..type(CarStorage)
    ;

It works in dartium but fails to load in dart2js. I get the following error:

Illegal argument(s): No type factory provided for CarStorage! (resolving GarageAppController -> CarStorage)
share|improve this question
add comment

1 Answer

up vote 2 down vote accepted

I discovered through some bug reports and guess work you need to add the DI Injectable annotation:

import 'package:di/annotations.dart';

@Injectable()
class CarStorage {
  ...
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.