Hello,
I didn't get student id in my ts file by routing,
Student.html file contains :
- <table>
- <tr><th>ID</th><th>Name</th><th>Age</th></tr>
- <tr *ngFor="let record of StudentList">
- <td><a [routerLink]="['/students',record.ID]">{{record.ID}}</a></td>
- <td>{{record.Name}}</td>
- <td>{{record.Age}}</td>
- </tr>
- </table>
Student.component.ts file :
- this._activatedRoute.params.subscribe(params => {
- this.studentId = params['StudId'];
- });
Routing file contains
- {path:'students/:StudId',component:StudentComponent}