0
當我把我的模板像鏢angular2 - 形式的指令#爲MyModel = 「ngForm」 不工作
<input id="password" name="password" class="form-control" type="password" [(ngModel)]="password" ngControl="password" #password="ngForm" required minlength="6" maxlength="30">
我不能啓動我的申請,我有以下消息:
Can't read 'package:website/login_component.template.dart' (Could not find asset website|lib/login_component.template.dart.).
import 'package:website/login_component.template.dart' as i2;
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[Warning from Dart2JS on atthecorner_website|web/main.dart]:
web/main.template.dart:33:1:
'i2' has no member named 'initReflector'.
i2.initReflector();
^^^^^^^^^^^^^^^^^^
如果我刪除屬性#password="ngForm"
它的作品。
我pubspec.yml:
name: website
description: website
version: 0.0.1
environment:
sdk: ">=1.13.0 <2.0.0"
dependencies:
angular2: 2.0.0-beta.20
browser: ^0.10.0
dart_to_js_script_rewriter: ^1.0.1
transformers:
- angular2:
platform_directives:
- 'package:angular2/common.dart#COMMON_DIRECTIVES'
- 'package:angular2/common.dart#FORM_DIRECTIVES'
platform_pipes:
- 'package:angular2/common.dart#COMMON_PIPES'
entry_points: web/main.dart
- dart_to_js_script_rewriter
我看着這個回購協議(https://github.com/angular-examples/forms)工作正常,但我看不出有什麼差別。
感謝您的幫助!
你能否請嘗試重新啓動'pub serve'並重試?你在用什麼IDE? –
感謝您的快速回復,我已經嘗試過,但不起作用。我使用jetbrain的IDE。 – matth3o
可能是https://github.com/angular/angular/issues/6028。變壓器的順序很重要。如果您的問題不同,請發佈您的'pubspec.yaml'中的變壓器部分。 –