0
votes

Error in ./AppComponent class AppComponent - inline template:0:0 caused by: No provider for Router!

import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
import { HttpClient, HttpClientModule, HttpClientJsonpModule } from '@angular/common/http';
import { ReactiveFormsModule, FormsModule } from '@angular/forms';

import { AppRoutingModule } from './app-routing.module';

import { GridModule } from '@progress/kendo-angular-grid';
import { LayoutModule } from '@progress/kendo-angular-layout';
import { ButtonsModule } from '@progress/kendo-angular-buttons';
import { DialogModule } from '@progress/kendo-angular-dialog';
import { DropDownsModule } from '@progress/kendo-angular-dropdowns';



@NgModule({
  declarations: [
    AppComponent,
    HeaderComponent,
    FooterComponent,

, ], imports: [ HttpClientModule, HttpClientJsonpModule, BrowserModule, BrowserAnimationsModule, AppRoutingModule, ReactiveFormsModule, FormsModule, GridModule, DialogModule, LayoutModule, ButtonsModule, DropDownsModule ], providers: [], bootstrap: [AppComponent] }) export class AppModule { }

Error in ./AppComponent class AppComponent - inline template:0:0 caused by: No provider for Router!

2

2 Answers

0
votes

please add this in app.module.ts

import { RouterModule, Routes } from '@angular/router';

imports: [
    RouterModule.forRoot([])
    // other imports here
  ]
0
votes

Seems Like there is issue in AppRoutingModule Module. If your routes defined in AppRoutingModule Loooks like

const routes: Routes = [
  { path: '', redirectTo: '/login', pathMatch: 'full'},
 { path: 'login', component: SignInComponent},
  { path: '**', redirectTo: '/login' }
];

Then probably u are missing import statement Like this in AppRoutingModule

 @NgModule({
      imports: [RouterModule.forRoot(routes)],
    })