I have a property in my typescript file
subject.component.ts
subject: string;
this.subject = "angular";
I want to pass this to my routerlink in my HTML file
subject.component.html
[routerLink]="[subject,'area']"
app.routes.ts
path: 'angular',
component: SubjectComponent,
children: [
{
path: 'area',
component: AreaComponent,
data: { subject: 'angular' }
}
path: 'angular2',
component: SubjectComponent,
children: [
{
path: 'area',
component: AreaComponent,
data: { subject: 'angular2' }
}
but I am having problems as it is not resolving out. The page requested is not being returned. I am re-directed to home-screen