I am building an app with asp.net mvc with angular 4. I have a shared layout which contain all the link of my page and it is .cshtml . When I give a link which will use angular routing.But when I click the link it is not working and page not showing.
My shared Layout link Code:
<li><a href="@Url.Action("Index","Admin")">User List</a></li>
<li><a href="@Url.Action("PermissionIndex","Admin")">Permission Index</a></li>
<li><a href="@Url.Action("RoleCreate","Admin")">Role Create</a></li>
<li><a href="@Url.Action("RoleIndex","Admin")">Role Index</a></li>
<li><a routerLink="/homes" routerLinkActive="active">Home</a> </li>
This is my Home Component:
import { Component } from '@angular/core';
@Component({
selector: 'homes',
templateUrl:"./home.component.html"
})
export class HomeComponent {
}
This is App routing module:
const routes: Routes = [
{ path: '', redirectTo: '/dashboard', pathMatch: 'full' },
{ path: 'dashboard', component: DashboardComponent },
{ path: 'detail/:id', component: HeroDetailComponent },
{ path: 'heroes', component: HeroesComponent },
{ path: 'homes', component: HomeComponent }
];
@NgModule({
//imports: [
// BrowserModule,
// FormsModule,
// RouterModule.forRoot(routes, { useHash: true }) // .../#/crisis-center/
//],
imports: [ RouterModule.forRoot(routes) ],
exports: [ RouterModule ]
})
When I click on home then nothing showing up.