routing.module.ts :
import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router'; // CLI imports router
import { BoardComponent } from './board/board.component';
import { ViewlistComponent } from './viewlist/viewlist.component';
const routes: Routes = [
{ path: '', component: ViewlistComponent },
{ path: 'View-List', component: ViewlistComponent },
]; // sets up routes constant where you define your routes
@NgModule({
imports: [RouterModule.forRoot(routes)],
exports: [RouterModule],
})
export class RoutingModule {}
app.component.html :
<div class="navbar">
<h1 class="brand">Project Manager / <small>Exemple</small></h1>
<span> </span>
<a class="main-btn" routerLink="/View-List" routerLinkActive="active"
>button2</a
>
</div>
<div class="interface"></div>
<!-- <app-board [board]=board></app-board>
<app-info></app-info> -->
<router-outlet></router-outlet>
As you see I'm trying to load my app, it's compiled successfully, but it's giving error when I load the app in browser. I'm trying to understand what I have done wrong in here. can anyone tell me the reason for this error ?
It seems that index.html is missing <my-app>
element. Could you check index.html
and add below in <body>
:
<my-app></my-app>
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments