Answers for "angular 'router-outlet' is not a known element:"

0

error ng8001 'router-outlet' is not a known element

import { RouterModule } from '@angular/router';
Posted by: Guest on April-23-2021
0

'router-outlet' is not a known element

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 {

}
Posted by: Guest on May-25-2020
0

router-outlet' is not a known element angular

@NgModule({
  imports: [
      BrowserModule,
      RouterModule
    ],
  exports : [RouterModule]
Posted by: Guest on January-24-2021

Code answers related to "angular 'router-outlet' is not a known element:"

Browse Popular Code Answers by Language