角度飞镖模块初始化问题

时间:2014-08-15 01:20:00

标签: dart angular-dart

我最近将角飞镖升级到最新版本[0.13.0]。从那时起,初始化应用程序变得非常困难。我花了大约一个星期与之抗争。我目前收到此错误:

  

内置库'dart:html'在独立版上不可用   VM。 'package:angular / application_factory.dart':错误:第19行pos 1:   库处理程序失败导入'dart:html'; ^

我哪里出错?

pubspec.yaml

name: abc
description: A sample web application
dependencies:
  angular: "0.13.0"
  browser: any
  http_server: any
  route_hierarchical: any
  web_components: any
transformers:
- angular

main.dart

import 'package:angular/angular.dart';
import 'package:angular/application_factory.dart';

import 'package:abc/main_module.dart';

void main()
{
      applicationFactory()
        .addModule(new MainModule())
        .run();
}

main_module.dart

library abc.main_module;

import 'package:angular/angular.dart';
import 'package:abc/formatters/capitalize_filter.dart';
import 'package:abc/components/index_controller.dart';
import 'package:abc/router.dart';

class MainModule extends Module
{
    MainModule()
    {
        bind(CapitalizeFilter);
        bind(IndexController);
        bind(RouteInitializerFn, toValue: MainRouteInitializer);
        bind(NgRoutingUsePushState, toFactory: (_) => new NgRoutingUsePushState.value(false));
    }
}

0 个答案:

没有答案