If 'router-outlet' is an Angular component, then verify that it is part of this module.
import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { FormsModule } from '@angular/forms';
import { RouterModule, Routes } from '@angular/router';
import { AppComponent } from './app.component';
import {DashboardComponent} from "./dashboard/dashboard.component"
const appRoutes: Routes = [
{
path: '',
redirectTo: '/dashboard',
pathMatch: 'full',
component: DashboardComponent
},
{
path: 'dashboard',
component: DashboardComponent
}
];
@NgModule({
imports: [
RouterModule.forRoot(appRoutes),
BrowserModule,
FormsModule
],
exports: [RouterModule],
declarations: [
AppComponent,
DashboardComponent
],
bootstrap: [AppComponent]
})
export class AppModule {
}@NgModule({
imports: [
BrowserModule,
RouterModule
Also in JavaScript:
- javascript map value nested object
- convert an image into Base64 string using JavaScript
- class merging
- javascript fetch json
- promise js
- create react app not creating template
- array javascript
- Function to convert an Array to an Associative array
- refresh page on button click jquery
- console.log clear screen
- unexpected template string expression no-template-curly-in-string react
- javascript the difference between innerText vs. innerHTML vs. textContent
- javascript check if all capital letter
- ajax file upload jquery
- javascript get last element of array pull
- javascript modify url without reloading page
- mapping a pojo with json via gson
- store console.timeEnd in variable js
- remove disabled attribute javascript
- arrow functions javascript
- wait javascript
- javascript new date undefined
- javascript closure function example
- import path nodejs