I can not find out why this is happening. From what I can see I am importing everything correctly. I have gone to other questions and have looked this over many times. I am probably missing something very simple and just not seeing it. Can I get some help as to why I am getting this error?
app.module.ts
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
import { MaterialModule } from './material.module';
import { AppComponent } from './app.component';
import { AppRoutingModule } from './app-routing.module';
import { DashboardComponent } from '../dashboard/dashboard.component';
@NgModule({
declarations: [
AppComponent,
DashboardComponent
],
imports: [
BrowserModule,
BrowserAnimationsModule,
MaterialModule,
AppRoutingModule
],
providers: [],
bootstrap: [AppComponent]
})
export class AppModule { }
app-routing.module.ts: I did not create this from the start of the project and that is why I am probably missing something.
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { RouterModule, Routes } from '@angular/router';
import { DashboardComponent } from '../dashboard/dashboard.component';
const routes: Routes = [
{ path: '', component: DashboardComponent }
];
@NgModule({
imports: [
CommonModule,
RouterModule.forRoot(routes)
],
declarations: []
})
export class AppRoutingModule {
}
In the app.component.html I have placed the <router-outlet></router-outlet>