I am implementing one demo project in Angular4 and I am also new in this(Angular4). I have seen one link,Angular2 module has no exported member, But I am not able to solve this problem.
app.module.ts
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { HttpModule } from '@angular/http';
import { RouterModule } from '@angular/router';
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
import { AppComponent } from './app.component';
import { VideoListComponent } from './training/video-list.component';
import { HomeComponent } from './training/home.component';
import { AddVideoComponent } from './training/add-video.component';
import { AboutusComponent } from './training/aboutus.component';
@NgModule({
declarations: [
AppComponent,
VideoListComponent,
HomeComponent,
AddVideoComponent,
AboutusComponent
],
imports: [
BrowserModule,
HttpModule,
FormsModule,
ReactiveFormsModule,
RouterModule.forRoot([
{path: 'home', component:HomeComponent},
{path: 'videos', component:VideoListComponent},
{path :'newvideo',component:AddVideoComponent},
{path: 'aboutus', component:AboutusComponent},
{path: '', redirectTo:'home',pathMatch:'full'},
{path: '**', redirectTo:'home',pathMatch:'full'}
])
],
bootstrap: [AppComponent]
})
export class AppModule { }
aboutus.component.ts
import { Component } from '@angular/core';
console.log('It works here');
@Component({
moduleId: module.id,
templateUrl: 'aboutus.html'
})
export class AboutusComponent {
s: string = "Hello";
constructor() {
console.log(this.s)
}
}
I want to add AboutusComponent than it is giving compile failed.
I am sharing my directory structure
It give me some error in browser(in below screen shot).
I want to add new module in angular4 Please share your idea.