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
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