本文介绍了Angular 2(4.0.0)Dart变压器不起作用-不支持的操作:需要使用“ angular2”变压器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Dart-1.24.2

Dart - 1.24.2

Angular-4.0.0

Angular - 4.0.0

铬-45.0.2454.104

Chromium - 45.0.2454.104

pubspec.yaml

pubspec.yaml

name: Test
description: A web app that uses AngularDart Components
version: 0.0.1
#homepage: https://www.example.com
#author: serhii <[email protected]>

environment:
sdk: '>=1.24.0 <2.0.0'

dependencies:
  angular: ^4.0.0
  angular_components: ^0.8.0

dev_dependencies:
  browser: ^0.10.0
  dart_to_js_script_rewriter: ^1.0.1

transformers:
- angular:
   entry_points:
      - web/applications/courier/courier.dart

- dart_to_js_script_rewriter

铬的输出:

package:angular/src/platform/bootstrap.dart:107 
Exception: Unsupported  operation: Using the 'angular2' transformer is required.      
Please see https://webdev.dartlang.org/angular/tutorial for setup  instructions,
and ensure your 'pubspec.yaml' file is configured to invoke the 'angular2'
transformer on your application's entry point.

如果我建立了这个-一切正常,如果我提供这个服务( pub服务)-一切正常,但我需要它在Chromium中工作。

If i build this - all is ok, if i serve this (pub serve) - all is ok but i need it to work in Chromium. Please help!

推荐答案

请确保您的入口点参数正确(路径和文件):

Make sure your entrypoint parameter is correct (path and file):

transformers:
- angular:
   entry_points:
      - web/applications/courier/courier.dart

重命名我的entry_point文件并且没有更新pubspec.yaml后,发生了非常相同的错误。

Had the very same error after renaming my entry_point file and didn't update pubspec.yaml.

这篇关于Angular 2(4.0.0)Dart变压器不起作用-不支持的操作:需要使用“ angular2”变压器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-30 00:37