Cannot find the module Angular2 Typescript
NickName:Aravind Ask DateTime:2017-01-03T11:18:38

Cannot find the module Angular2 Typescript

My vscode shows error in the line Cannot find the module and highlights CreateTaskComponent line of app.module.ts

My code

app.module.ts

import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';

import { AppComponent }  from './app.component';
import { CreateTaskComponent} from './app/taskList/create-task.component';
@NgModule({
  imports: [ BrowserModule ],
  declarations: [ AppComponent, CreateTaskComponent ],
  bootstrap: [ AppComponent ]
})
export class AppModule { }

create-task.component.ts

import {Component} from '@angular/core';
@Component({
    selector:'create-task',
    templateUrl: 'app/taskList/create-task.component.html'

})
export class CreateTaskComponent{
        pageTitle : string ='Create a Task';

}

Folder structure is

enter image description here

Copyright Notice:Content Author:「Aravind」,Reproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/41435923/cannot-find-the-module-angular2-typescript

More about “Cannot find the module Angular2 Typescript” related questions

Cannot find module 'angular2/angular2' in VS2013 and typescript 1.6.2

My own project use MVC4. I try to add tsconfig.json "experimentalDecorators": true change project TypeScriptExperimentalDecorators = true and TypeScriptEmitDecoratorMetadata = true and it's...

Show Detail

Got "Cannot find module 'angular2/angular2'" using gulp-typescript

I want to use Angular 2 with TypeScript and compile to JavaScript using gulp-typescript. But I got error Cannot find module 'angular2/angular2'.. Then, I tried to change code like the following. C...

Show Detail

Typescript Angular2 error cannot find module angular/x

This app uses jspm for javascript module loading, so all of the angular2 typescript definition files are in jspm_modules folder. I get errors that Typescript cannot find module 'angular/core', 'an...

Show Detail

gulp-typescript giving module not found error for angular2

I use gulp-typescript to compile the angular2 app. I get the following error. C:/src/Terminal.Web/src/Terminal.Web/node_modules/angular2/src/facade/async.d.ts(3,53): error TS2307: Cannot find ...

Show Detail

Angular2 beta and gulp-tsc - Cannot find module 'angular2/core'

I am trying to automate the typescript compilation with the new angular 2.0 beta. The project structure is: myapp |--node_modules |---angular2 |--core.d.ts |--... |--...

Show Detail

cannot find module ./in-memory-data.service Angular2

I am following the Angular 2 Tutorial (Tour of Heroes) but I am unable to finish the 7'th Tutorial regarding http which simulates a web api using angular-in-memory-web-api. Everything is exactly ho...

Show Detail

TypeDoc can not find Angular2 modules

I am trying to generate doc files by using TypeDoc. When I run TypeDoc with the follwing command: /node_modules/.bin/typedoc --module system --target ES5 --exclude *.spec.ts* --experimentalDecorat...

Show Detail

Cannot find external module 'angular2/http'

I used the latest angular.d.ts v2.0.0-alpha.31 and angular.dev.js v31. when i execute the tsc or compile my typescript code it says "Cannot find external module 'angular2/http'"

Show Detail

angular2: Cannot find module '@angular/core'

I followed the angular2 quick start to create my project and everything works fine but my "tsc -w" command line keeps on telling me: app/components/company/company.ts(1,36): error TS2307: Cannot f...

Show Detail

TypeScript error in Angular2 code: Cannot find name 'module'

I have defined the following Angular2 component: import {Component} from 'angular2/core'; @Component({ selector: 'my-app', moduleId: module.id, templateUrl: './app.component.html' })&#x

Show Detail