Angularjs 2 RC5表单无法加载



这是一个非常恼人的问题。我的包。json是:

 "dependencies": {
     "@angular/common": "2.0.0-rc.5",
    "@angular/compiler": "2.0.0-rc.5",
    "@angular/core": "2.0.0-rc.5",
    "@angular/forms": "0.3.0",
    "@angular/http": "2.0.0-rc.5",
    "@angular/platform-browser": "2.0.0-rc.5",
    "@angular/platform-browser-dynamic": "2.0.0-rc.5",
    "@angular/router": "3.0.0-rc.1",
    "@angular/router-deprecated": "2.0.0-rc.2",
    "@angular/upgrade": "2.0.0-rc.5",
     "angular2-in-memory-web-api": "0.0.15",
    "systemjs": "0.19.36",
    "core-js": "^2.4.0",
    "reflect-metadata": "^0.1.3",
    "rxjs": "5.0.0-beta.11",
    "zone.js": "^0.6.12",
    "bootstrap": "^3.3.6"
  },

但是当我使用这个时:

import { FormsModule }      from '@angular/forms';
@NgModule({
  imports: [ BrowserModule, FormsModule ],

调度错误,找不到表单。此外,我在angular/forms目录中也没有看到FormsModule了。

有没有人可以告诉我你是如何在angular2中导入表单的?

我试了这个:

import { FORM_DIRECTIVES }      from '@angular/forms';
@NgModule({
  imports: [ BrowserModule, FORM_DIRECTIVES ],

但是现在在我的webConsole中,我确实看到了:

zone.js:101 GET http://localhost:3010/node_modules/@angular/forms@0.3.0//bundles/forms.umd.js 404 (Not Found)

为什么它一直添加0.3.0到表单名?应该是:

http://localhost:3010/node_modules/@angular/forms/bundles/forms.umd.js 

//在app.module.ts

//对于数据驱动的表单——>

import { DataDrivenComponent } from "./data-driven/data-driven.component";
import { ReactiveFormsModule } from '@angular/forms';

//其他必要的导入

import { BrowserModule  } from '@angular/platform-browser';
import { AppComponent }   from './app.component';
import { NgModule } from '@angular/core';

//Ng模块
@NgModule({
    declarations: [AppComponent, DataDrivenComponent],
    imports: [BrowserModule, ReactiveFormsModule],
    bootstrap: [AppComponent]
})

//导出类
export class AppModule {}

最新更新