Tuesday, 4 April 2017

Angular2 TypeScript - error TS2307: Cannot find module 'angular2/forms'

My component file contains:

import { Component } from '@angular/core';

@Component({
  selector: 'my-app',
  template: `<user></user>
  `,
})
export class AppComponent  {

}

My app.modules :

import { NgModule }      from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { FormsModule }   from '@angluar/forms';
import { AppComponent }  from './app.component';
import { UserComponent } from './components/user.component';

@NgModule({
  imports:      [ BrowserModule ,FormsModule],
  declarations: [ AppComponent, UserComponent],
  bootstrap:    [ AppComponent ]
})
export class AppModule { }

when i try to compile my code i got this error : error TS2307: Cannot find module 'angular2/forms' Thanks!



via Aminfo

No comments:

Post a Comment