编译的AngularDart在dynamic_injector中失败并出错

时间:2014-01-19 01:27:52

标签: dart angular-dart dart2js dart-mirrors

我一直在尝试使AngularDart工作,但我总是得到未定义对象的异常。

@MirrorsUsed(
targets: const [
    'angular.core',
    'angular.core.dom',
    'angular.core.parser',
    'angular.routing',
    'angular.core.zone',
    'di.di',
    'di.dynamic_injector',
    NodeTreeSanitizer,
    DynamicParser,
    DynamicParserBackend,
    Injector
],
metaTargets: const [
    NgInjectableService,
    NgComponent,
    NgDirective,
    NgController,
    NgFilter,
    NgAttr,
    NgOneWay,
    NgOneWayOneTime,
    NgTwoWay,
    NgCallback,
    NgZone
],
override: '*'
)
import 'dart:mirrors';

编译javascript显示错误:

Uncaught TypeError: Cannot call method 'get$parameters' of undefined dynamic_injector.dart:42
DynamicInjector.newInstanceOf$4 dynamic_injector.dart:42

当我删除MirrorsUsed2时没有错误,但编译文件很大。

2 个答案:

答案 0 :(得分:2)

添加这些对我有帮助

    'angular.filter',
    'angular.perf',
    'perf_api',

而不是angular.core.parser

    'angular.core.parser.dynamic_parser'
    'angular.core.parser.lexer'

我还添加了自己的所有库。

另见https://code.google.com/p/dart/issues/detail?id=14686

答案 1 :(得分:0)

最近,我发现Dart-AngularJS编译后不运行,即使是最简单的例子。我将我的dart sdk重新安装到最新的稳定版本,错误消失了。你能看出这是否有效吗?请参阅github项目上的related issue